Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 20, 2007, 19:16 UTC
- Message-ID
- <7vd50vl30r.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <e5bfff550705201156m244e1cf0v7e6b3ab43fa3b47b@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
Show 25 quoted lines
> On 5/20/07, Junio C Hamano <junkio@cox.net> wrote:
> ...
>> > diff --git a/builtin-apply.c b/builtin-apply.c
>> > index 0399743..6032f78 100644
>> > --- a/builtin-apply.c
>> > +++ b/builtin-apply.c
>> > ...
>> > @@ -1770,6 +1800,10 @@ static int apply_one_fragment(struct buffer_desc *desc,
>> > if (match_beginning && offset)
>> > offset = -1;
>> > if (offset >= 0) {
>> > +
>> > + if (desc->size - oldsize - offset == 0) /* end of file? */
>> > + newsize -= trailing_added_lines;
>> > +
>> > int diff = newsize - oldsize;
>> > unsigned long size = desc->size + diff;
>> > unsigned long alloc = desc->alloc;
>>
>> But we have kept our sources -Wdeclaration-after-statement
>> clean so far
>
> ??????
>
> Wie bitte?Sorry I forgot to mention that that is "trivial" so there is no reason to resend. I don't expect me doing much git stuff for the rest of the day, but you'll hear from me about this patch later (hopefully it would appear on 'next' -- we'll see).