Given an arbitrary, executable Git post-commit hook it is not run during a non-interactive rebase, neither with rebase --force-rebase
nor with rebase --no-ff
which is a synonym for the former in non-interactive mode according to the GIT-REBASE(1) Manpage.
But by doing an interactive rebase with rebase --interactive --no-ff
the very same Git hook is run on post-commit.
Can someone explain the rationale behind this behavior.
But by doing an interactive rebase with
rebase --interactive --no-ff
, the very same Git hook is run onpost-commit
.
Actually, the post-commit
hook is not run on an interactive rebase since Git 2.17+ (Q4 2017)
It is only run again (on git rebase -i
) with Git 2.25+ (Q1 2020): "rebase -i
" ceased to run the post-commit
hook by mistake in an earlier update, which has been corrected.
See commit 4627bc7, commit 49697cb, commit 12bb7a5, commit 6a619ca, commit b2dbacb, commit 88a92b6 (15 Oct 2019) by Phillip Wood (phillipwood
).
(Merged by Junio C Hamano -- gitster
-- in commit 5c8c0a0, 10 Nov 2019)
sequencer
: runpost-commit
hookSigned-off-by: Phillip Wood
Prior to commit 356ee4659b ("
sequencer
: try to commit without forking 'git commit'", 2017-11-24, Git v2.17.0-rc0 -- merge listed in batch #2) the sequencer would always run thepost-commit
hook after each pick or revert as it forkedgit commit
to create the commit.The conversion to committing without forking
git commit
omitted to call thepost-commit
hook after creating the commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With