Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow code_style.py to work from a git hook #9233

Commits on Jun 6, 2024

  1. Allow code_style.py to work from a git hook

    When running a git hook, git sets certain environment variables (such
    as GIT_INDEX_FILE) which force git to look at the main repository,
    overriding other options. This trips up code_style.py whenever it
    tries to run a git command on the framework submodule.
    
    Fix this by explicitly clearing git-related environment-variables
    before running git commands on the framework. This is recommended
    by git's documentation[1]:
    
    > Environment variables, such as GIT_DIR, GIT_WORK_TREE, etc., are
    > exported so that Git commands run by the hook can correctly locate
    > the repository. If your hook needs to invoke Git commands in a
    > foreign repository or in a different working tree of the same
    > repository, then it should clear these environment variables so
    > they do not interfere with Git operations at the foreign location.
    
    [1] https://git-scm.com/docs/githooks
    
    Signed-off-by: David Horstmann <[email protected]>
    davidhorstmann-arm committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    330680e View commit details
    Browse the repository at this point in the history
  2. Remove multi-type variable

    Signed-off-by: David Horstmann <[email protected]>
    davidhorstmann-arm committed Jun 6, 2024
    Configuration menu
    Copy the full SHA
    f8bbc2d View commit details
    Browse the repository at this point in the history