Re: rebase invoking pre-commit
- From
- Phillip 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 >