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

Re: git gui replaces amend message when prepare-commit-msg hook is used

From
Antoine Pelisse <apelisse@gmail.com>
Date
Jul 5, 2013, 19:13 UTC
Message-ID
<CALWbr2y52fHae=svf6vct1gRR-o1ocG_iF3yppHDipx1jjuODg@mail.gmail.com>
In-Reply-To
<CAGHpTBJhwzLdxiTynx-eBWj7wUwe4e6HPAB4g0jDHTeVF2rfeg@mail.gmail.com>
On Thu, Jul 4, 2013 at 2:46 PM, Orgad Shaneh <orgads@gmail.com> wrote:
Show 23 quoted lines
> On Thu, Jul 4, 2013 at 3:42 PM, Antoine Pelisse <apelisse@gmail.com> wrote:
>>>> Your problem is that your hook script is not checking $2 so it is
>>>> overwriting the message even when you do not want to do so.
>>>
>>> No, it isn't. Not by git-gui at least. Check /tmp/hook.log with the
>>> hook I provided...
>>
>> So what you mean is that the hook is not executed with the correct parameters?
>> Could you please provide the output of the /tmp/hook.log file (I can't
>> reproduce right now) ?
>
> It only runs for "New commit" (possibly with merge or squash as
> arguments). In my case the log is:
> .git/PREPARE_COMMIT_MSG
> .git/PREPARE_COMMIT_MSG
> .git/PREPARE_COMMIT_MSG
> ...
>
> Not running the hook for amend is another problem.
>
> What I referred to was that handling the hook's result is done without
> checking if the state has changed while it was running, like Fredrik
> has already pointed out.

Yep, I've had a quick look at that, and clearly the problem seems to come from git-gui. I have absolutely no knowledge of TCL so I won't be able to help. Indeed, from what I've seen it looks like prepare-commit-message hook is not called in amend case.

I cc'ed Pat Thoyts as he's the maintainer of git-gui.
Sorry for not being able to help any further on this one.
Antoine,
Previous: Orgad Shaneh
Message 12 of 12 in “git gui replaces amend message when prepare-commit-msg hook is used”
  1. Orgad ShanehJul 4, 2013
  2. Fredrik GustafssonJul 4, 2013
  3. Orgad ShanehJul 4, 2013
  4. Fredrik GustafssonJul 4, 2013
  5. John KeepingJul 4, 2013
  6. Orgad ShanehJul 4, 2013
  7. Fredrik GustafssonJul 4, 2013
  8. John KeepingJul 4, 2013
  9. Orgad ShanehJul 4, 2013
  10. Antoine PelisseJul 4, 2013
  11. Orgad ShanehJul 4, 2013
  12. Antoine PelisseJul 5, 2013

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.