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

Re: [PATCH 2/2] commit: add support for --fixup <commit> -m"<extra message>"

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 20, 2017, 21:50 UTC
Message-ID
<CAPig+cRDi14Rez+6ZJAEdxHpo0Mw7JQFkcuG2oVqv2pP_ZbvhQ@mail.gmail.com>
In-Reply-To
<87bmit5b8a.fsf@evledraar.gmail.com>

On Wed, Dec 20, 2017 at 4:40 PM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 22 quoted lines
> On Wed, Dec 20 2017, Eric Sunshine jotted:
>> On Wed, Dec 20, 2017 at 2:38 PM, Ævar Arnfjörð Bjarmason
>> <avarab@gmail.com> wrote:
>>> +test_expect_success 'commit --fixup -m"something" -m"extra"' '
>>> +       commit_for_rebase_autosquash_setup &&
>>> +       git commit --fixup HEAD~1 -m"something" -m"extra" &&
>>> +       commit_msg_is "fixup! target message subject linesomething
>>> +
>>> +extra"
>>> +'
>>
>> Hmm, so the first -m appended to the "fixup!" line, but the second -m
>> appended after a blank line? That doesn't seem very intuitive.
>>
>> Also, doesn't the text following "fixup!" need to exactly match the
>> summary line of the commit message in order for "git rebase -i
>> --autosquash" to work? Am I overlooking something obvious?
>
> It does the right thing and it's actually
> "$fixup_line\n\n$first_m\n\n$second_m" etc. It's just that this
> commit_msg_is function is testing against the "%s%b" format, so the
> first line of the body comes right after the subject.

Thanks for explaining. I guess I should have delved into commit_msg_is() before commenting.

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 5 of 16 in “commit doc: document that -c, -C, -F and --fixup with -m error”
  1. 1/2 commit doc: document that -c, -C, -F and --fixup with -m errorÆvar Arnfjörð Bjarmason, Dec 20, 2017
  2. 2/2 commit: add support for --fixup <commit> -m"<extra message>"Ævar Arnfjörð Bjarmason, Dec 20, 2017
  3. Eric SunshineDec 20, 2017
  4. Ævar Arnfjörð BjarmasonDec 20, 2017
  5. Eric SunshineDec 20, 2017
  6. 0/2 support -m"<msg>" combined with commit --fixupÆvar Arnfjörð Bjarmason, Dec 22, 2017
  7. 1/2 commit doc: document that -c, -C, -F and --fixup with -m errorÆvar Arnfjörð Bjarmason, Dec 22, 2017
  8. Eric SunshineDec 22, 2017
  9. Ævar Arnfjörð BjarmasonDec 22, 2017
  10. 2/2 commit: add support for --fixup <commit> -m"<extra message>"Ævar Arnfjörð Bjarmason, Dec 22, 2017
  11. Junio C HamanoDec 22, 2017
  12. Junio C HamanoDec 22, 2017
  13. Ævar Arnfjörð BjarmasonDec 22, 2017
  14. Junio C HamanoDec 22, 2017
  15. Ævar Arnfjörð BjarmasonDec 23, 2017
  16. Eric SunshineDec 20, 2017

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.