Bug 49955 - gendiff should pretend diffs are made the traditional way
Summary: gendiff should pretend diffs are made the traditional way
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm
Version: 7.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 2001-07-25 17:10:27 UTC
Embargoed:


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


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