From: Junio C Hamano Date: Thu, 05 Jun 2008 18:39:05 GMT Subject: Re: [PATCH 1/2] Allow git-apply to fix up the line counts Message-ID: <7v4p873ewm.fsf@gitster.siamese.dyndns.org> In-Reply-To: Johannes Schindelin writes: > As I said, the data is in the _hunks_, but I maybe should have added _not > in the hunk headers_. So you _are_ ignoring the line counts recorded in the hunk headers. It is not even 'adjust' but 'count lines to guess'. If the incoming patch text does not have confusing contents at the end, the guessing is reasonably safe. You need to watch out for blank lines, which means the same as /^ $/, and mail signature separators /^-- $/. They can confuse you into guessing wrongly and include more preimage lines than there actually are. So it would be more like --ignore-line-counts:: Ignore number of lines recorded in the hunk headers; instead count lines that look like hunk contents to determine how big each hunk is. I haven't started to nitpick the actual code yet but I know the original is a tricky pice of code, so we may find something interesting ;-)