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

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

Change "patch" to output unified-diff rejects


From: Wayne Davison
Subject: Change "patch" to output unified-diff rejects
Date: Thu, 29 Jan 2004 11:32:12 -0800
User-agent: Mutt/1.5.5.1+cvs20040105i

I'd like to see the patch program output its reject files in unified
diff format rather than using context diff format.  Besides being easier
to read (IMO), it also makes manual patching easier because the user
doesn't need to remember to remove the extra space after the '+'
character.  I can't remember why I didn't do this back when I created
the unified diff, but I figure "better late than never".

Attached is a patch for the 2.5.9 version of patch.  I borrowed code
from the apply_hunk() routine in the new abort_hunk() routine, so the
logic should be pretty safe.  The only thing I'm not sure of is the
lines that might have a '\n' pch_end character -- the new code discards
these lines (like the apply_hunk() routine does) instead of outputting
them.

..wayne..

Attachment: unified-reject.patch
Description: Text document


reply via email to

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