git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-gui: executed hooks are different from command-line git if hooksPath is set

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Apr 1, 2019, 20:46 UTC
Message-ID
<nycvar.QRO.7.76.6.1904012244520.41@tvgsbejvaqbjf.bet>
In-Reply-To
<CAODFU0rSSeLReFKci_p3kjJwxD65R21syDTHoKcqWJ0wbF8jZQ@mail.gmail.com>
Hi Jan,
On Mon, 1 Apr 2019, Jan Ziak wrote:
Show 20 quoted lines
> Command-line "git commit" and graphical "git gui" commit are invoking
> different hooks if hooksPath is set in $HOME/.gitconfig.
>
> Namely, in my case command-line "git commit" runs
> "/home/atom/dev/git-hooks/post-commit" - while "git gui" commit runs
> ".git/hooks/post-commit".
>
> Please run the attached shell script in an empty directory to
> reproduce this issue. The script is using strace to determine which
> hook is being executed. The script will run "git gui": the user is
> expected to simply commit changes from the gui and then close the gui
> for the script to finish.
>
> Script output:
>   command-line: access("/home/atom/dev/git-hooks/post-commit", X_OK)
>   gui: access(".git/hooks/post-commit", X_OK)
>
> $ cat ~/.gitconfig
> [core]
>     hooksPath = /home/atom/dev/git-hooks

Could you give `master` of https://github.com/git-for-windows/git a try? (Despite the name, we aim to keep it functional on the same platforms as Git itself.)

I am fairly certain that I fixed it there, and contributed a PR to the Git GUI project, but it seems that that project is in a kind of hibernating state right now.

Ciao, Johannes

Previous: Jan ZiakNext: Jan Ziak
Message 2 of 3 in “git-gui: executed hooks are different from command-line git if hooksPath is set”
  1. Jan ZiakApr 1, 2019
  2. Johannes SchindelinApr 1, 2019
  3. Jan ZiakApr 2, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.