bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change "patch" to output unified-diff rejects


From: Wayne Davison
Subject: Re: Change "patch" to output unified-diff rejects
Date: Tue, 3 Feb 2004 11:36:00 -0800
User-agent: Mutt/1.5.5.1+cvs20040105i

On Sat, Jan 31, 2004 at 10:27:03PM -0800, Paul Eggert wrote:
> Why does abort_hunk_unified test for '!' or '='?

The '!' stuff was left over from when the code also handled context
diffs.  The '=' check is just my copying the logic from apply_hunk().
(I was being careful to duplicate the assumptions in that code, just
to be safe.)  Your new code certainly looks like it will work fine,
though.  I see that you've also opted to assume that there are no '\n'
lines, which I believe to be safe as well.

> If the hunk contains just 1 "old" or "new" line, the ",count" part of
> the header should be surpressed, as "diff" does.

In my original design/implementation the ",count" part was always
mandatory, but this was later changed after the initial gnu diff
release.  So either one is legal -- use your preference.

> Also, "diff" uses funky line numbering if the count is 0

You are right that the "-1,0" that my patch would have output for
creating a new file no longer works in patch (I think it used to,
but that was probably a long time ago).  Your new patch fixes this.

> How about this patch instead?

Looks good to me.  I've done some limited testing, and it works as
expected.

..wayne..




reply via email to

[Prev in Thread] Current Thread [Next in Thread]