git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Config options -c in rebase --continue not passed to prepare-commit-msg hook

From
DDDevste 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
Next: Jeff King
Message 1 of 2 in “Config options -c in rebase --continue not passed to prepare-commit-msg hook”
  1. Devste DevsteSep 4, 2025
  2. Jeff KingSep 5, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.