git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git-gui: executed hooks are different from command-line git if hooksPath is set
@ 2019-04-01 13:57 Jan Ziak
  2019-04-01 20:46 ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Ziak @ 2019-04-01 13:57 UTC (permalink / raw)
  To: Git Mailing List

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

Hello

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

git version 2.21.0

Sincerely
Jan

[-- Attachment #2: a.sh --]
[-- Type: application/x-shellscript, Size: 821 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-02 23:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 13:57 git-gui: executed hooks are different from command-line git if hooksPath is set Jan Ziak
2019-04-01 20:46 ` Johannes Schindelin
2019-04-02 23:35   ` Jan Ziak

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).