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

Re: rebase invoking pre-commit

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Dec 22, 2023, 10:05 UTC
Message-ID
<bf1ce173-50d7-405f-88c1-7edb7ec5a55a@gmail.com>
In-Reply-To
<m0sf3vi86g.fsf@epic96565.epic.com>
Hi Sean
On 21/12/2023 20:58, Sean Allred wrote:
> Is there a current reason why pre-commit shouldn't be invoked during
> rebase, or is this just waiting for a reviewable patch?

The reason that we don't run the pre-commit hook is that the commit being rebased may have been created with "git commit --no-verify" and so running the pre-commit hook would stop it from being rebased - see e637122ef2 (rebase -m: do not trigger pre-commit verification, 2008-03-16).

I think that most of the time it would be valuable to run the pre-commit hook when committing a conflict resolution but we'd need to add something like "git rebase --continue --no-verify" as a way to bypass it when resolving conflicts in commits that were created with "git commit --no-verify".

Best Wishes
Phillip
Show 9 quoted lines
> This was brought up before at [1] in 2015, but that thread so old at
> this point that it seemed prudent to double-check before investing time
> in a developing and testing a patch.
> 
> [1]: https://lore.kernel.org/git/1m55i3m.1fum4zo1fpnhncM%25lists@haller-berlin.de/
> 
> --
> Sean Allred
> 
Previous: Sean AllredNext: Sean Allred
Message 2 of 8 in “rebase invoking pre-commit”
  1. Sean AllredDec 21, 2023
  2. Phillip WoodDec 22, 2023
  3. Sean AllredDec 22, 2023
  4. Junio C HamanoDec 26, 2023
  5. Elijah NewrenDec 23, 2023
  6. Sean AllredDec 31, 2023
  7. Elijah NewrenJan 5, 2024
  8. Junio C HamanoJan 5, 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.