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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: a.sh
Description: application/shellscript


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux