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

Re: [PATCH] merge: Run commit-msg hook

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 26, 2016, 13:02 UTC
Message-ID
<alpine.DEB.2.20.1607261456480.14111@virtualbox>
In-Reply-To
<1469519323-11420-1-git-send-email-orgad.shaneh@audiocodes.com>
Hi Orgad,
On Tue, 26 Jul 2016, Orgad Shaneh wrote:
> From: Orgad Shaneh <orgads@gmail.com>

Again, this is unnecessary if you already send the mail from the same address.

> commit-msg is needed to either validate the commit message or edit it.
> Gerrit for instance uses this hook to append its Change-Id footer.
> 
> This is relevant to merge commit just like any other commit.
Hmm. This is not very convincing to me, as
- if you call commit-msg in `git merge` now, why not `prepare-commit-msg`?
- a merge is a different beast from a simple commit. That is why we have
  two different commands for them. A hook to edit the merge message may
  need to know the *second* parent commit, too, for example to generate
  a diffstat, or to add information about changes in an "evil commit".
- if Gerrit is the intended user, would it not make more sense to
  introduce a new hook, e.g. `merge-msg` (and `prepare-merge-msg`), as you
  have to teach Gerrit a new trick anyway?
- if Gerrit is the intended user, why does it not simply edit the merge
  message itself? After all, it executes it, and probably crafts a merge
  message mentioning that this is an automatic merge, anyway, so why not
  add the Change-Id *then*?

Ciao, Dscho

Previous: Orgad ShanehNext: Orgad Shaneh
Message 2 of 7 in “merge: Run commit-msg hook”
  1. merge: Run commit-msg hookOrgad Shaneh, Jul 26, 2016
  2. Johannes SchindelinJul 26, 2016
  3. Orgad ShanehJul 26, 2016
  4. Johannes SchindelinJul 26, 2016
  5. Junio C HamanoJul 26, 2016
  6. Junio C HamanoJul 26, 2016
  7. Johannes SchindelinJul 27, 2016

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.