git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: Git List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>, Pat Notz <patnotz@gmail.com>
Subject: Re: [PATCH 2/2] commit: add support for --fixup <commit> -m"<extra message>"
Date: Wed, 20 Dec 2017 22:40:53 +0100	[thread overview]
Message-ID: <87bmit5b8a.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CAPig+cSeRZR7J9WSozTETVu=Y9N2wMRpoCgUkLXyzAaBOmTNZw@mail.gmail.com>


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:
>> Add support for supplying the -m option with --fixup. Doing so has
>> errored out ever since --fixup was introduced. Before this, the only
>> way to amend the fixup message while committing was to use --edit and
>> amend it in the editor.
>
> I can't tell, based upon this description, if '-m<msg> --edit' is a
> valid combination and, if so, does it correctly open the editor after
> appending <msg>?

Yes, that's works as expected for all the options, and this doesn't
break that.

>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>> diff --git a/t/t7500-commit.sh b/t/t7500-commit.sh
>> @@ -272,6 +272,14 @@ test_expect_success 'commit --fixup provides correct one-line commit message' '
>>         commit_msg_is "fixup! target message subject line"
>>  '
>>
>> +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 the review of both patches. I'll clarify the points raised in
commit message for v2 pending further feedback.

  reply	other threads:[~2017-12-20 21:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 19:38 [PATCH 1/2] commit doc: document that -c, -C, -F and --fixup with -m error Ævar Arnfjörð Bjarmason
2017-12-20 19:38 ` [PATCH 2/2] commit: add support for --fixup <commit> -m"<extra message>" Ævar Arnfjörð Bjarmason
2017-12-20 20:03   ` Eric Sunshine
2017-12-20 21:40     ` Ævar Arnfjörð Bjarmason [this message]
2017-12-20 21:50       ` Eric Sunshine
2017-12-22 16:00         ` [PATCH v2 0/2] support -m"<msg>" combined with commit --fixup Ævar Arnfjörð Bjarmason
2017-12-22 19:53           ` Eric Sunshine
2017-12-22 20:43             ` Ævar Arnfjörð Bjarmason
2017-12-22 16:00         ` [PATCH v2 1/2] commit doc: document that -c, -C, -F and --fixup with -m error Ævar Arnfjörð Bjarmason
2017-12-22 20:41         ` [PATCH v2 2/2] commit: add support for --fixup <commit> -m"<extra message>" Ævar Arnfjörð Bjarmason
2017-12-22 21:28           ` Junio C Hamano
2017-12-22 21:29             ` Junio C Hamano
2017-12-22 21:58             ` Ævar Arnfjörð Bjarmason
2017-12-22 22:06               ` Junio C Hamano
2017-12-23 12:49                 ` Ævar Arnfjörð Bjarmason
2017-12-20 19:45 ` [PATCH 1/2] commit doc: document that -c, -C, -F and --fixup with -m error Eric Sunshine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmit5b8a.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=patnotz@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).