Re: [PATCH 2/7] contrib/subtree: Use %B for Split Subject/Body

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> "David A. Greene" <greened@xxxxxxxxxxxxx> writes:
>
>> From: Techlive Zheng <techlivezheng@xxxxxxxxx>
>>
>> Use %B to format the commit message and body to avoid an extra newline
>> if a commit only has a subject line.
>>
>> Signed-off-by: Techlive Zheng <techlivezheng@xxxxxxxxx>
>>
>> Signed-off-by: David A. Greene <greened@xxxxxxxxxxxxx>
>> ---
>
> This time (only), I'll try to fix them up at my end, but please
> check your toolchain, find out where the extra blank line between
> S-o-b: lines we see above come from, and fix that, so that I won't
> have to do so again.

Will do.

>>  contrib/subtree/git-subtree.sh     |    6 +++++-
>>  contrib/subtree/t/t7900-subtree.sh |   15 +++++++++++++++
>>  2 files changed, 20 insertions(+), 1 deletion(-)
>>
>> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
>> index 920c664..5341b36 100755
>> --- a/contrib/subtree/git-subtree.sh
>> +++ b/contrib/subtree/git-subtree.sh
>> @@ -296,7 +296,11 @@ copy_commit()
>>  	# We're going to set some environment vars here, so
>>  	# do it in a subshell to get rid of them safely later
>>  	debug copy_commit "{$1}" "{$2}" "{$3}"
>> -	git log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%n%b' "$1" |
>> +	# Use %B rather than %s%n%n%b to handle the special case of a
>> +	# commit that only has a subject line.  We don't want to
>> +	# introduce a newline after the subject, causing generation of
>> +	# a new hash.
>> +	git log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' "$1" |
>
> The new format template is fine, but I do not think the comment
> should be there.  It does not give any useful information to people
> who are reading the end result of applying this patch and is useful
> only in the context of comparing the old and new templates, iow, it
> belongs to the commit log message.

I'll delete the comment.

                           -David
--
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]