Re: [PATCH] Force new line at end of commit message

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

 



Hi,

On Wed, 26 Dec 2007, Junio C Hamano wrote:

> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 090c3e5..d0d83c3 100755
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -215,15 +215,17 @@ make_squash_message () {
>  		COUNT=$(($(sed -n "s/^# This is [^0-9]*\([1-9][0-9]*\).*/\1/p" \
>  			< "$SQUASH_MSG" | tail -n 1)+1))
>  		echo "# This is a combination of $COUNT commits."
> -		sed -n "2,\$p" < "$SQUASH_MSG"
> +		sed -e 1d -e '2,/^./{
> +			/^$/d
> +		}' <"$SQUASH_MSG"

If I read this correctly (haven't tested), then _all_ empty lines are 
removed from the SQUASH_MSG, right?  This is not what I want.

I had something like this in mind, rather:

		-e '\$s/\n*$/\n/'

This is completely untested, but should show the idea.  However, the same 
must go into this clause:

>  	else
>  		COUNT=2
>  		echo "# This is a combination of two commits."
>  		echo "# The first commit's message is:"
>  		echo
>  		git cat-file commit HEAD | sed -e '1,/^$/d'

Unfortunately, I am unable to provide a proper patch with proper testing 
right now, since my family threatens me with physical violence, should I 
not leave the keyboard right n.. OUCH!

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

  Powered by Linux