Bug 237561 - [PATCH] gendiff doesn't emit unified diff headers
[PATCH] gendiff doesn't emit unified diff headers
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-23 15:37 EDT by Ville Skyttä
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-17 06:07:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Emit unified diff headers for compatibility (526 bytes, patch)
2007-04-23 15:37 EDT, Ville Skyttä
no flags Details | Diff

  None (edit)
Description Ville Skyttä 2007-04-23 15:37:18 EDT
Unlike diff(1) when producing diffs containing multiple files (with -r), ditto
version control systems, gendiff does not emit unified diff headers for each
file in the diff.  This (especially missing headers between files) causes some
compatibility issues, for example with GNU Emacs' diff-mode.el.  Fix against
rpm.org hg attached.
Comment 1 Ville Skyttä 2007-04-23 15:37:18 EDT
Created attachment 153308 [details]
Emit unified diff headers for compatibility
Comment 2 Jeff Johnson 2007-04-23 19:35:23 EDT
Do you have an example of the different behavior?
Without encyclopaedic knowledge of diff, I find
it hard to tell what the changed output would look like.

There are also reasons to avoid bash-isms for portability of gendiff.
Comment 3 Ville Skyttä 2007-04-24 12:11:03 EDT
Which bashisms does the patch in comment 1 introduce?  That wasn't intentional.

The unified diff headers added by the patch are the "diff ..." lines before each
hunk as seen when comparing eg. these:
http://koti.welho.com/vskytta/gendiff-before.patch
http://koti.welho.com/vskytta/gendiff-after.patch

According to my experience, it doesn't really matter exactly what the line
between hunks contains as long as it doesn't start with a space, plus or minus
(and IIRC eg. GNU Arch generates empty lines there), but this patch mimicks what
"diff -r ..." adds itself.
Comment 4 Jeff Johnson 2007-04-24 16:36:12 EDT
My tired old eyes say thanks! for the examples. So diff-mode.el wants an echo of the diff command that 
was run, easy enuf, can/will do.

The bash-isms are not from your patch, apologies for muttering offhandedly.

Too many diff's, so much uglix, and gendiff is just a 21 line loop with a man page.
Comment 5 Paul Nasrat 2007-05-17 06:07:56 EDT
Commited to rpm.org tree, will be in next release. Thanks for the patch

Note You need to log in before you can comment on or make changes to this bug.