Bug 49955 - gendiff should pretend diffs are made the traditional way
gendiff should pretend diffs are made the traditional way
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2001-07-25 12:44 EDT by David Nečas
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-07-25 13:10:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Nečas 2001-07-25 12:44:08 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)

Description of problem:
While it's good gendiff can make diff from single directory structure, 
it's more useful to have diffs looking like they were generated the 
traditionaly way, from two directories, i.e. the extenstion marking 
originals is appended to directory name instead of file name.

How reproducible:

Steps to Reproduce:
This would change gendiff behaviour to what I described:

--- gendiff.orig        Wed Jul 25 14:49:02 2001
+++ gendiff     Wed Jul 25 14:49:02 2001
@@ -6,9 +6,12 @@
   exit 1

+d=`echo $1 | sed -e 's#/$##'`
 find $1 \( -name "*$2" -o -name ".*$2" \) -print |
 while read f; do
     [ "${f##*/}" == "ChangeLog$2" ] && U=-U0
-    diff ${U} $f `echo $f | sed s/$2\$//`
+    # pretend we're making diff the traditional way
+    diff ${U} $f `echo $f | sed s/$2\$//` \
+      | sed -e "1 s#^--- ${d}\\([^[:space:]]*\\)$2\\(.*\\)\$#--- ${d}$2\\1

Additional info:

This is controverse.  Just forget it, if you see a reason why not to 
change it.
Comment 1 David Nečas 2001-07-25 13:10:22 EDT
It seems my browser broke the before-last line of the patch, it should read 
(everyhing on one line):

| sed -e "1 s#^--- ${d}\\([^[:space:]]*\\)$2\\(.*\\)\$#--- ${d}$2\\1\\2#"

Comment 2 Jeff Johnson 2001-07-29 11:28:17 EDT
This would be the Right Thing To Do only if there were a stronger
convention on naming files that were diffed. SInce patch
does the Right Thing anyways, I see little reason to adjust
the output of gendiff to conform to a mostly nonexistent convention.

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