Config options -c in rebase --continue not passed to prepare-commit-msg hook
- From
- Devste Devste <devstemail@gmail.com>
- Date
- Sep 4, 2025, 12:46 UTC
- Message-ID
- <CANM0SV0+t7x_VTtZNCO8rKo1vvxhJjwEdmjLDN70njxCo7DofQ@mail.gmail.com>
For some reason neither environment variables nor -c is passed to the prepare-commit-msg hook when rebasing. Other parameters (e.g. -C /path/to/repo) are passed correctly/it's running the command in the correct repo
Reproduction: 1) Create a prepare-commit-msg hook with content echo "prepare-commit-msg hook" echo "$FOO" git config --get hooks.foobar exit 1
2) rebase a branch with conflicts. After resolving a conflict run: FOO=bar git -c hooks.foobar=hello rebase --continue
The hook is executed but neither $FOO nor the config are set (both echo an empty line) Output: prepare-commit-msg hook
Expected output: prepare-commit-msg hook bar hello
Git 2.51.0