Re: [PATCH] commit: --amend -m '' silently fails to wipe message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> Jeff King <peff@xxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]