Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Marco Costalba
Date: Sunday, May 20, 2007 - 1:55 pm

On 5/20/07, Junio C Hamano <junkio@cox.net> wrote:


Ok. Thanks for your help.

P.S: I don't find a trivial way to avoid adding more lines then
removed, the shortest trick I can find is

int eof = (desc->size - oldsize - offset == 0);
int diff = newsize - oldsize - eof * trailing_added_lines;
unsigned long size = desc->size + diff;
unsigned long alloc = desc->alloc;

newsize -= eof * trailing_added_lines;


But is not as elegant as the original.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove ..., Frank Lichtenheld, (Sun May 20, 12:17 pm)
Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove ..., Marco Costalba, (Sun May 20, 1:55 pm)
Re: [PATCH] Teach 'git-apply --whitespace=strip' to remove ..., Josef Weidendorfer, (Mon May 21, 1:59 am)