Re: rebase invoking pre-commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 5, 2024, 16:26 UTC
- Message-ID
- <xmqqttnroig4.fsf@gitster.g>
- In-Reply-To
- <m0sf3vi86g.fsf@epic96565.epic.com>
Sean Allred <allred.sean@gmail.com> writes:
Show 8 quoted lines
> Is there a current reason why pre-commit shouldn't be invoked during > rebase, or is this just waiting for a reviewable patch? > > 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/
If you are trying to make it less likely that your developers would commit conflict markers by mistake, I think an effective way would be to give "git rebase" an option (or a configuration variable) that forbids it from making a new commit upon "git rebase --continue", which AFAIK was added merely to help "lazy" folks to omit the explicit "git commit" step in the following sequence:
$ git rebase origin/master
... stops with conflicts
$ edit
... now the conflicts are resolved (and hopefully you have
... tested the result)
$ git commit
$ git rebase --continue