Skip to content

idea: stg repair improvement #181

@NonLogicalDev

Description

@NonLogicalDev

I have been giving stg repair workflow a lot of thought recently and I have a few ideas on how to make it more advanced user friendly and less magic.

(The proposals and thoughts listed below are additions to repair toolkit, not replacements for auto fixup functionality)

Although for the most part repair does a decent job of fixing up mistakes I feel like we could give the user more control if they know what they are doing.

Repair operation essentially consists of fixing up the metadata to match the current stack of diffs as closely as possible.

For manual operation I propose we could add two core operations:

  • stg repair --rewind
    • Which would mark all patches as popped and will sync up the metadata head to the current one.
    • The most basic simple manual option (no data loss whatsoever), and gets the user back into operational state immediately.
      • Also this will be potentially way faster on giant monorepos.
    • This opens up the ability to manually uncommit back the commits transforming them into new patches. (while keeping the old patches unapplied above in the stack for reference)
    • This sort of mimics what stg repair does today (or used to do recently) but leaves it up to deal with fixing up the stack.
  • stg repair --remap PATCH_ID NEW_SHA which would only work on unapplied patches.
    • Advanced option allows changing what any given unapplied patch is mapped to.
    • Allows the user to manually sync up the stack

Metadata

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