git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Adam Dinwoodie" <adam@dinwoodie.org>,
	git@vger.kernel.org, "Chris Webb" <chris@arachsys.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH] commit: --amend -m '' silently fails to wipe message
Date: Thu, 7 Apr 2016 15:02:11 -0400	[thread overview]
Message-ID: <20160407190210.GA4478@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqshyxz3ss.fsf@gitster.mtv.corp.google.com>

On Thu, Apr 07, 2016 at 11:12:19AM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I guessed that this might have come from the conversion of "message"
> > form a pointer (which could be NULL) into a strbuf. And indeed, it looks
> > like f956853 (builtin-commit: resurrect behavior for multiple -m
> > options, 2007-11-11) did that.
> 
> Yikes.  That is a quite ancient breakage.
> 
> The funny thing is that we did address the same breakage in 25206778
> (commit: don't start editor if empty message is given with -m,
> 2013-05-25), but didn't notice that there are other breakages of the
> same nature.
> 
> I think all message.len check can and should be have_option_m
> instead.
> 
>  - The one in the first hunk is a fix for the issue that "-m ''" is
>    ignored and we read from use_message etc., which is the original
>    issue in this thread.
> 
>  - The second one is a fix for your "git commit -m '' -F f" example
>    that does not error out.
> 
>  - The last one is a fix for "git -c commit.template=f commit -m ''"
>    that still uses the template file 'f'.

Yes, FWIW, those were the sites and reasons I identified last night.
Your patch looks like the right thing to me.

-Peff

  reply	other threads:[~2016-04-07 19:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 17:15 [PATCH] commit: --amend -m '' silently fails to wipe message Adam Dinwoodie
2016-04-07  4:42 ` Jeff King
2016-04-07  4:48   ` Jeff King
2016-04-07 18:12     ` Junio C Hamano
2016-04-07 19:02       ` Jeff King [this message]
2016-04-07 19:56         ` Junio C Hamano
2016-04-07 20:28           ` Jeff King
2016-04-07  9:50   ` Adam Dinwoodie
2016-04-07 19:02     ` Jeff King

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=20160407190210.GA4478@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=adam@dinwoodie.org \
    --cc=avarab@gmail.com \
    --cc=chris@arachsys.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).