Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 68555

Summary: editdiff (really rediff) fails
Product: [Retired] Red Hat Raw Hide Reporter: Ulrich Drepper <drepper>
Component: patchutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-10-11 15:52:22 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:
Attachments:
Description Flags
Test input none

Description Ulrich Drepper 2002-07-11 03:43:51 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a+) Gecko/20020628

Description of problem:
I'll append a test file which contains a patch.  If editdiff is used and the
first chunk is removed rediff will abort and leave no usable find behind.  Total
loss of data.

This applies as far as I can see to al versions up to and including the current
raw hide which is why I've filed the bug for rawhide.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.editdiff AAAA
2.remove first chunk
3.leave editor
	

Actual Results:  rediff: src/rediff.c:468: show_modified_hunk: Assertion
`!read_atatline (line, &orig_offset, &orig_count, &new_offset, &new_count)' failed.
/usr/bin/editdiff: line 68: 11476 Aborted                 rediff
"${TMPD}/${NAME}.orig" "${TMPD}/${NAME}" >"${FILE}"


Expected Results:  new patch with first chunk removed

Additional info:

Comment 1 Ulrich Drepper 2002-07-11 03:46:02 UTC
Created attachment 64744 [details]
Test input

Comment 2 Tim Waugh 2002-07-11 06:30:22 UTC
editdiff backs the original file up with extension '.orig', so it shouldn't cause data loss. 
 
Thanks for the test case. 


Comment 3 Tim Waugh 2002-07-11 06:49:11 UTC
Rediff only handles unified diff format currently, I'm afraid.  I'll stick in a check there to make it 
do something sensible when confronted with context diff.

Comment 4 Tim Waugh 2002-07-11 06:58:24 UTC
The check is now in CVS.

Comment 5 Tim Waugh 2002-07-11 07:00:22 UTC
As a work-around, you can use filterdiff to select hunks from a diff.  At least filterdiff 
understands context format.

Comment 6 Tim Waugh 2002-10-16 17:20:58 UTC
This check is now in patchutils-0.2.17-1.