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

[bug][git-gui] Git gui is not executing prepare-commit-msg hooks when run from a worktree

From
BPBertrand Provost <provost.bertrand@gmail.com>
Date
Jul 20, 2021, 14:32 UTC
Message-ID
<CAPKfN0NJ65Qmx+tCPi2L_QhPfFcrhAHMSb2JSYSe26mtkcwf+Q@mail.gmail.com>
Hello,
What did you do before the bug happened? (Steps to reproduce your issue)
- Create a worktree of a git in a new directory
- Add prepare-commit-msg hook
- Open `git gui` UI from the worktree directory

What did you expect to happen? (Expected behavior) It should fill the commit field with the hooks

What happened instead? (Actual behavior) Nothing

The hook works fine in the original directory (with the full .git)

[System Info] git version: git version 2.31.1 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.4.0-77-generic #86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021 x86_64 compiler info: gnuc: 9.3 libc info: glibc: 2.31 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks] prepare-commit-msg

-- 
Bertrand Provost
Next: Pratyush Yadav
Message 1 of 2 in “[bug][git-gui] Git gui is not executing prepare-commit-msg hooks when run from a worktree”
  1. Bertrand ProvostJul 20, 2021
  2. Pratyush YadavJul 20, 2021

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.