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

Re: [BUG REPORT] git-gui invokes prepare-commit-msg hook incorrectly

From
Johannes Sixt <j6t@kdbg.org>
Date
Jul 7, 2024, 13:25 UTC
Message-ID
<028ae5d6-b587-4ffe-b837-38f2c13992ae@kdbg.org>
In-Reply-To
<xmqqtth2petz.fsf@gitster.g>
Am 06.07.24 um 20:15 schrieb Junio C Hamano:
Show 14 quoted lines
> There may be two classes of comments CLI "git commit" users would be
> seeing, ones coming from the "git commit" itself that describe what
> CLI "git commit" does (e.g., "lines starting with '#' are ignored",
> "absolutely empty message buffer aborts the command"), and others
> coming from project specific template and other mechanisms that
> describe what the project expects (e.g., "please keep your lines
> shorter than 72 columns").
> 
> I agree that it makes perfect sense not to show the former at all to
> the end-user in git-gui UI, especially if git-gui does not ignore
> lines starting with '#' or abort commit with an empty message.
> 
> I am not sure if it is safe to strip the latter out of user's view,
> though.

I see your point. These two kinds of comments have different topics (usage of the tool being used vs. project conventions concerning the commit message itself).

It is easy to clean only MERGE_MSG to solve the annoyance caused by the list of conflicted files. We could have this a first step, and then we can consider later whether cleaning other sources is worth it. But it would not help OP, where the comments come from the commit message template.

-- Hannes
Previous: Junio C HamanoNext: Brian Lyles
Message 7 of 10 in “[BUG REPORT] git-gui invokes prepare-commit-msg hook incorrectly”
  1. brianmlylesJul 5, 2024
  2. Eric SunshineJul 5, 2024
  3. Sean AllredJul 5, 2024
  4. Eric SunshineJul 5, 2024
  5. Johannes SixtJul 6, 2024
  6. Junio C HamanoJul 6, 2024
  7. Johannes SixtJul 7, 2024
  8. Brian LylesJul 8, 2024
  9. Johannes SixtJul 8, 2024
  10. Oswald BuddenhagenAug 7, 2024

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.