{"thread":{"id":"50853","subject":"git-gui: executed hooks are different from command-line git if hooksPath is set","startedAt":"2019-04-01T13:57:31Z","lastAt":"2019-04-02T23:35:23Z","messageCount":3,"participants":["Jan Ziak","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"372890","messageId":"CAODFU0rSSeLReFKci_p3kjJwxD65R21syDTHoKcqWJ0wbF8jZQ@mail.gmail.com","threadId":"50853","inReplyTo":null,"subject":"git-gui: executed hooks are different from command-line git if hooksPath is set","fromName":"Jan Ziak","fromEmail":"0xe2.0x9a.0x9b@gmail.com","sentAt":"2019-04-01T13:57:17Z","receivedAt":"2019-04-01T13:57:31Z","isPatch":false,"sender":{"key":"0xe2.0x9a.0x9b@gmail.com","avatar":"https://gravatar.com/avatar/f5c8ab1a4a405f877f5caf23a7105cae64785ae147161b93922c6e26020be3e5?d=mp&s=160"},"body":"Hello\n\nCommand-line \"git commit\" and graphical \"git gui\" commit are invoking\ndifferent hooks if hooksPath is set in $HOME/.gitconfig.\n\nNamely, in my case command-line \"git commit\" runs\n\"/home/atom/dev/git-hooks/post-commit\" - while \"git gui\" commit runs\n\".git/hooks/post-commit\".\n\nPlease run the attached shell script in an empty directory to\nreproduce this issue. The script is using strace to determine which\nhook is being executed. The script will run \"git gui\": the user is\nexpected to simply commit changes from the gui and then close the gui\nfor the script to finish.\n\nScript output:\n  command-line: access(\"/home/atom/dev/git-hooks/post-commit\", X_OK)\n  gui: access(\".git/hooks/post-commit\", X_OK)\n\n$ cat ~/.gitconfig\n[core]\n    hooksPath = /home/atom/dev/git-hooks\n\ngit version 2.21.0\n\nSincerely\nJan\n"},{"id":"372937","messageId":"nycvar.QRO.7.76.6.1904012244520.41@tvgsbejvaqbjf.bet","threadId":"50853","inReplyTo":"CAODFU0rSSeLReFKci_p3kjJwxD65R21syDTHoKcqWJ0wbF8jZQ@mail.gmail.com","subject":"Re: git-gui: executed hooks are different from command-line git if hooksPath is set","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-04-01T20:46:14Z","receivedAt":"2019-04-01T20:46:12Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jan,\n\nOn Mon, 1 Apr 2019, Jan Ziak wrote:\n\n> Command-line \"git commit\" and graphical \"git gui\" commit are invoking\n> different hooks if hooksPath is set in $HOME/.gitconfig.\n>\n> Namely, in my case command-line \"git commit\" runs\n> \"/home/atom/dev/git-hooks/post-commit\" - while \"git gui\" commit runs\n> \".git/hooks/post-commit\".\n>\n> Please run the attached shell script in an empty directory to\n> reproduce this issue. The script is using strace to determine which\n> hook is being executed. The script will run \"git gui\": the user is\n> expected to simply commit changes from the gui and then close the gui\n> for the script to finish.\n>\n> Script output:\n>   command-line: access(\"/home/atom/dev/git-hooks/post-commit\", X_OK)\n>   gui: access(\".git/hooks/post-commit\", X_OK)\n>\n> $ cat ~/.gitconfig\n> [core]\n>     hooksPath = /home/atom/dev/git-hooks\n\nCould you give `master` of https://github.com/git-for-windows/git a try?\n(Despite the name, we aim to keep it functional on the same platforms as\nGit itself.)\n\nI am fairly certain that I fixed it there, and contributed a PR to the Git\nGUI project, but it seems that that project is in a kind of hibernating\nstate right now.\n\nCiao,\nJohannes\n"},{"id":"372997","messageId":"CAODFU0q9-02k_OtHh8+fo-rm8AxpmaE_fqiEhoS2cmfrxrim=A@mail.gmail.com","threadId":"50853","inReplyTo":"nycvar.QRO.7.76.6.1904012244520.41@tvgsbejvaqbjf.bet","subject":"Re: git-gui: executed hooks are different from command-line git if hooksPath is set","fromName":"Jan Ziak","fromEmail":"0xe2.0x9a.0x9b@gmail.com","sentAt":"2019-04-02T23:35:10Z","receivedAt":"2019-04-02T23:35:23Z","isPatch":false,"sender":{"key":"0xe2.0x9a.0x9b@gmail.com","avatar":"https://gravatar.com/avatar/f5c8ab1a4a405f877f5caf23a7105cae64785ae147161b93922c6e26020be3e5?d=mp&s=160"},"body":"On Mon, 1 Apr 2019 at 22:46, Johannes Schindelin\n<Johannes.Schindelin@gmx.de> wrote:\n> Could you give `master` of https://github.com/git-for-windows/git a try?\n> (Despite the name, we aim to keep it functional on the same platforms as\n> Git itself.)\n>\n> I am fairly certain that I fixed it there, and contributed a PR to the Git\n> GUI project, but it seems that that project is in a kind of hibernating\n> state right now.\n\nHello Johannes\n\nYou are right. git-gui.sh in `master` of\nhttps://github.com/git-for-windows/git is respecting the hooksPath\nspecified in ~/.gitconfig.\n\nExecuting \"git-for-windows/git rev-parse --git-path hooks/post-commit\"\nas part of the process works fine but it seems a bit inefficient.\n\nSincerely\nJan\n"}]}