Skip to content

Auto-pop a chain of patches to avoid merge conflicts #429

Open
@bonki

Description

Assume we have A---B---C1---C2---D---E where {A,B,D,E} are completely unrelated to one another and C2 builds on top of C1.
While working on E we understand that C1 introduced a bug which requires extensive debugging so we would like to pop C1 and continue working on E. Unfortunately, solely popping C1 would of course lead to a merge conflict when stg tries to re-apply C2. Fortunately, C2 isn't relevant for us either while continuing our work on E so we can e.g. undo and pop both patches in a batch.

Ideally, I would like to be able to do something along the lines of

$ stg pop --follow foo  # C1

which would pop all required (consecutive?) patches starting at foo so that the result would be a conflict-free state, if possible. In the scenario above this would leave us with C1..C2 popped, in the worst case scenario this would pop foo..top, which might also be fine.

This avoids either (i) the cognitive overhead of having to know which patches are related and require to be unapplied together or (ii) having to go through an iterative dance of commands to avoid/resolve merge conflicts which we aren't really interested in.

The worst case is that too many patches get popped (i.e. an immediate patch which is required for us to continue working), but at least it would only take a single command to know that as well as tell us which range of patches exactly one would need to have a closer look at, instead of arriving at this point iteratively.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions