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

includeIf not matching during `git rebase`

From
MMMichał 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-upstream
where 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

Next: Emily Shaffer
Message 1 of 4 in “includeIf not matching during `git rebase`”
  1. Michał MirosławJul 25, 2023
  2. Emily ShafferJul 25, 2023
  3. Junio C HamanoJul 25, 2023
  4. Glen ChooJul 27, 2023

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.