Skip to content

git-gui: respect modern hooks paths#1757

Merged
dscho merged 2 commits into
git-for-windows:masterfrom
dscho:git-gui-hooks-path
Jul 11, 2018
Merged

git-gui: respect modern hooks paths#1757
dscho merged 2 commits into
git-for-windows:masterfrom
dscho:git-gui-hooks-path

Conversation

@dscho

@dscho dscho commented Jul 10, 2018

Copy link
Copy Markdown
Member

Git started to support a couple of features in the meantime, one of which is to override the hooks path via the config.

Let's teach Git GUI about them.

This fixes #1755

/cc @luismbo

dscho and others added 2 commits July 10, 2018 13:52
Since v2.9.0, Git knows about the config variable core.hookspath
that allows overriding the path to the directory containing the
Git hooks.

Since v2.10.0, the `--git-path` option respects that config
variable, too, so we may just as well use that command.

For Git versions older than v2.5.0 (which was the first version to
support the `--git-path` option for the `rev-parse` command), we
simply fall back to the previous code.

This fixes git-for-windows#1755

Initial-patch-by: Philipp Gortan <philipp@gortan.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let's try to address git-for-windows#1755 this way.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@luismbo

luismbo commented Jul 10, 2018

Copy link
Copy Markdown

Works for me. Tested by manually patching mingw64/libexec/git-core/git-gui.tcl. Thanks!

@dscho dscho merged commit 27a24fd into git-for-windows:master Jul 11, 2018
@dscho dscho deleted the git-gui-hooks-path branch July 11, 2018 20:03
@dscho

dscho commented Jul 11, 2018

Copy link
Copy Markdown
Member Author

Thanks, @luismbo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git GUI does not execute commit hooks when running from a secondary worktree

2 participants