bugQuilt - Bugs: bug #63986, Feature request: Conditional...

 
 

bug #63986: Feature request: Conditional auto-refresh, allow auto-refresh on bad hunks

Submitter:  Daniel Richard G. <iskunk>
Submitted:  Sat 01 Apr 2023 07:53:27 AM UTC
   
 
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 01 Apr 2023 07:53:27 AM UTC, original submission:  

Scenario: You have a large number of patches in a long-running project, all of which apply cleanly, but have normal variations: the line numbers are off here and there, some don't use the a/b prefix convention, some have the old Index: header, etc. You are bringing in a bunch of new patches, several of which don't apply cleanly and need refreshing.

If you start from an empty stack, and run "quilt push -a --refresh", then all the patches get refreshed---not just the ones that actually need it. This is especially unhelpful if the patches are in a VCS; the maintainer now has a large diff to review and it is mostly useless churn.

I would like to see a flag that modifies the behavior of --refresh to limit refreshing to patches that quilt explicitly identifies as needing a refresh. Any patches which already apply cleanly should remain untouched.

Also useful would be another flag or two that allows this auto-refreshing to be applied to (1) hunks which refer to non-existent files, and (2) rejected hunks, instead of the program bailing out and the user having to do the refresh manually. (This would obviously be at the user's own risk, and a status message should be shown.) My particular use case only involves #1, but #2 may be helpful in some instances.

Currently, I have to use some machinery around quilt to get the behavior I need. The following goes into a makefile:

quilt_auto_refresh = \
        while :; do \
                (set -x; $(QUILT) push -a -f -q) | tee tmp.quilt.out; \
                ! grep -q 'FAILED -- saving rejects' tmp.quilt.out || exit; \
                if tail -n 1 tmp.quilt.out | grep -q 'forced; needs refresh'; then \
                        (set -x; $(QUILT) refresh) || exit; \
                else \
                        tail -n 1 tmp.quilt.out | grep -q '^Now at patch' || exit; \
                        break; \
                fi; \
        done \
        && rm -f tmp.quilt.out


This is intended to error out on conflicting hunks, while automatically refreshing patches that refer to missing files. (I am importing patches from a project that uses a larger variant of the same source tree.)

Daniel Richard G. <iskunk>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by iskunk (Submitted the item)
  •  

    There are 0 votes 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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-04b1.
    Corresponding source code