bugGNU patch - Bugs: bug #34031, patch should have a mode for...


bug #34031: patch should have a mode for rejecting patches that require offsets

Submitter:  Eric Blake <ericb>
Submitted:  Tue 16 Aug 2011 11:08:22 PM UTC
Votes: 1
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Sat 04 Feb 2023 01:38:11 AM UTC, comment #1: 

I've implemented this feature and attached the patch. Dan

Tue 16 Aug 2011 11:08:22 PM UTC, original submission:  

See original thread at: https://lists.gnu.org/archive/html/bug-patch/2011-08/msg00004.html

Short summary - there are some contexts, like RPM spec files, where patch series are supposed to be perfect (no offsets).  I encountered a case of an ambiguous patch with 3 lines of context (it took 6 lines of context before the patch became unambiguous), and when generated against the wrong version of the file, the patch was silently applied by 'patch -s --fuzz=0' even though patch had to guess at which ambiguous point to apply the patch.  Worse, 'git apply' picked a different point than 'patch', rendering the rpc broken but only according to which tool chain applied the patch series.  That is, --fuzz=0 didn't reject the patch, and -s hid the message, making the problem undetectable.

If there were an option to reject patch offsets, the rpm would have been identified as broken up front, and the broken patch in the series fixed to list the right offsets for a 0-offset application.  Of course, the option should not be default (offsets are a very useful feature when applying patches from disparate points in time), but clients like rpm patch series would benefit from it.

Eric Blake <ericb>


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

Attach Files:

Attached Files
file #54314:  0001-Add-the-max-offset-option.patch added by None (5KiB - text/x-patch - Implement --max-offset)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by correabuscar (Voted in favor of this item)
  • -email is unavailable- added by ericb (Submitted the item)

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-07-04 correabuscar Carbon-Copy- Added correabuscar
    2023-02-04 None Attached File- Added 0001-Add-the-max-offset-option.patch, #54314

    Back to the top

    Powered by Savane 3.13-3736.
    Corresponding source code