bugGNU patch - Bugs: bug #25833, Patch fails to correctly apply...

 
 

bug #25833: Patch fails to correctly apply hunks with asymmetric context

Submitted by:  Andreas Gruenbacher <agruen>
Submitted on:  Thu 12 Mar 2009 08:21:50 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Andreas Gruenbacher <agruen>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 02 Apr 2009 04:48:59 AM UTC, comment #2:

This patch needed to be reverted (commit 49f7877). It caused beginning-of-file or end-of-file hunks to apply anywhere in a file with little or no fuzz. This may be undesirable; we can only apply such hunks with more fuzz.

Intead, allow such hunks to apply only when no more context remains (and the hunk has become symmetric; commit 106fcaa).

Andreas Gruenbacher <agruen>
Project AdministratorIn charge of this item.
Sun 29 Mar 2009 12:18:53 AM UTC, comment #1:

Fixed in git and in patch-2.5.9-49-gdf890ca.tar.gz (ftp://alpha.gnu.org/gnu/patch).

Andreas Gruenbacher <agruen>
Project AdministratorIn charge of this item.
Thu 12 Mar 2009 08:21:50 AM UTC, original submission:

Patch assumes that hunks with fewer context lines at the top than at the bottom can only match at the beginning of the file, and hunks with fewer lines at the bottom can only match at the end. This assumption is not documented, and it is broken: hunks with asymmetric context can easily result from editing patches, and such hunks are perfectly valid.

The result is that patches with such hunks will apply with fuzz +N if the prefix context is N lines longer or shorter than the suffix context.

Andreas Gruenbacher <agruen>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #17661:  fix-partial-context.diff added by agruen (3KiB - text/x-diff - A possible fix)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by agruen (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 29 Mar 2009 12:18:53 AM UTCagruenStatusNone=>Fixed
      Assigned toNone=>agruen
      Open/ClosedOpen=>Closed
    Thu 12 Mar 2009 08:22:35 AM UTCagruenAttached File-=>Added fix-partial-context.diff, #17661

    Back to the top


    Powered by Savane 3.1-cleanup1