Bug 49955

Summary: gendiff should pretend diffs are made the traditional way
Product: [Retired] Red Hat Linux Reporter: David Nečas <yeti>
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1Keywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-07-25 17:10:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Nečas 2001-07-25 16:44:08 UTC
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:
Always

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
     U=-u
     [ "${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
\\2#"
 done


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 17:10:22 UTC
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 15:28:17 UTC
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.