Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- May 21, 2007, 11:23 UTC
- Message-ID
- <e5bfff550705210423i34dc481es61d3b886ae77c5f7@mail.gmail.com>
- In-Reply-To
- <7vmyzyhdfh.fsf@assigned-by-dhcp.cox.net>
On 5/21/07, Junio C Hamano <junkio@cox.net> wrote:
Show 14 quoted lines
> Junio C Hamano <junkio@cox.net> writes: > > > We somehow end up removing one LF too many, like this: > > diff --git a/contrib/emacs/.gitignore b/contrib/emacs/.gitignore > index c531d98..016d3b1 100644 > --- a/contrib/emacs/.gitignore > +++ b/contrib/emacs/.gitignore > @@ -1 +1 @@ > -*.elc > +*.elc > \ No newline at end of file >
I also had that, but after adding
+ + if (empty < trailing_added_lines) + empty--; +
everything worked correctly. I made again the same test myself without problems.
I really don't understand how could be broken.
For me it's OK if you don't like my patch, but I would really understand why that very strange error.
Thanks Marco