git rebase backend change: post-checkout hook is not ran by 'merge' backend
- From
Philippe Blain <levraiphilippeblain@gmail.com>
- Date
- Apr 2, 2020, 15:57 UTC
- Message-ID
- <9945492E-1D97-4741-B999-F30CA561D4DE@gmail.com>
Hello,
I'm not sure if this has been reported yet (couldn't find it), but I noticed a behavioral difference between the merge and apply backends that is not mentioned in the documentation: The 'apply' backend will run the post-checkout hook just after moving HEAD to the commit we are rebasing onto; this does not happen with the merge backend:
$ echo "echo \"Running post-checkout hook\"" > .git/hooks/post-checkout
$ git checkout -b <branch1> <commit2>
$ git rebase upstream/master --apply
First, rewinding head to replay your work on top of it...
Running post-checkout hook
Applying: <commit1>
Applying: <commit2>
$ git checkout -b <branch2> <commit2>
Successfully rebased and updated refs/heads/<branch2>Cheers, Philippe.