Bug 49955 - gendiff should pretend diffs are made the traditional way
Summary: gendiff should pretend diffs are made the traditional way
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 7.1
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2001-07-25 16:44 UTC by David Nečas
Modified: 2007-04-18 16:35 UTC (History)
0 users

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

Attachments (Terms of Use)

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:

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 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.

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