includeIf not matching during `git rebase`
- From
- Michał Mirosław <emmir@google.com>
- Date
- Jul 25, 2023, 19:49 UTC
- Message-ID
- <CABb0KFF1vqMLa5DLYd_c9sQeZbhkhQ=Q0bE7W41nmMFmNWB4tg@mail.gmail.com>
* What did you do before the bug happened? (Steps to reproduce your issue)
With ~/.gitconfig having:
[includeIf "onbranch:pr/"]
path = .gitconfig.for-upstreamwhere the included config changes commit-msg hook,
git checkout pr/zzz # has multiple commits over upstream git rebase -i
> 'edit' first commit
(modify it) git rebase --continue
* What did you expect to happen? (Expected behavior)
The commit messages are unchanged.
* What happened instead? (Actual behavior)
The rebased commits had messages modified by default commit-msg hook.
* What's different between what you expected and what actually happened?
I'd expect includeIf to match and in effect prevent the default commit message modifications.
[System Info] git version: git version 2.41.0.487.g6d72f3e995-goog cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh compiler info: gnuc: 12.2 libc info: glibc: 2.36 $SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks] commit-msg pre-commit prepare-commit-msg