Re: [PATCH] Force new line at end of commit message
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 30, 2007, 10:26 UTC
- Message-ID
- <Pine.LNX.4.64.0712301124510.14355@wbgn129.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7vodc99gpy.fsf@gitster.siamese.dyndns.org>
Hi,
On Sat, 29 Dec 2007, Junio C Hamano wrote:
Show 17 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> >> 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.
>
> That is no what I wanted either.
>
> "1d" removes the "# This is a combination of <$n> commits." from
> the previous round, "2,/^./{ ... }" says apply what's in {} to
> lines from second line to the first non-empty line, and what's
> in {} is to remove empty ones.Okay, so it removes only the empty lines between the first line and the next non-empty line.
But if I understood the OP correctly, the problem was a missing newline at the end of the commit message, no?
Thanks, Dscho