Search code examples
gitmsysgitgit-gui

Which $VARIABLES can be passed to an external tool from git-gui?


When I add a new tool to git-gui, the dialog indicates that I could use some variables to be passed to the tool ($REVISION, $ARGS, $FILENAME).

Are there any other parameters that are not documented (for example the current repo directory, etc.)? Why are they not contained in the documentation of the git-gui?

My current use case is that I have two scripts that enable/disable a pre-commit hook. Currently, I have to open my Windows Explorer and double-click the batch-files which is a bit clumsy. Easier way would be to do that directly out of git-gui...

As an alternative (side-question), I would also be interested in bypassing the pre-commit hook (i.e. pass --no-verify when committing) out of git-gui.


Solution

  • When looking at the git-gui sources, I find (not present in git-gui man page):

    • git-gui.sh:
      • $GITGUI_VERBOSE, to enable verbose loading
      • SSH_ASKPASS, to suggest our implementation of askpass, if none is set
      • GIT_DIR and GIT_WORK_TREE, for repository setup