Skip to content

mr op auto-commits ALL tracked changes, not just staged — silently widens the commit #338

Description

@fdaviddpt

Summary

The mr op (push + create MR) commits every tracked change in the working tree, not just what the caller staged. A single-purpose MR can silently absorb unrelated tracked edits the author never intended to ship.

Reproduction (real, this session)

  1. Made a one-line change to .supertool.json and committed only that file.
  2. The working tree also had an unrelated pre-existing tracked change (.claude/remember/team/max/2026-06.md) left over from a prior session.
  3. Ran mr:body.md|15m|LABELS expecting to push the one-file commit.
  4. The op ran git add across all tracked changes and auto-committed the memory file too — the MR shipped 2 files.
  5. Stripping the extra file then required a force-push, which is (correctly) blocked by the agent's destructive-action guard. Dead end — the MR had to ship with the unintended file.

The auto-add is what turned a clean one-file MR into an unrecoverable two-file one.

Why it's wrong

mr is push+create, not "stage everything." The author has usually already curated their commit(s). Auto-git add -A overrides that curation, and because the next step pushes immediately, there's no chance to catch it before it's remote — at which point fixing it needs history rewriting.

Proposed fix

  • Default: commit/push only what's already staged (or the existing commits on the branch). Do not auto-add unstaged/untracked tracked changes.
  • If there are extra tracked changes not in the commit, warn and require confirmation: N tracked changes not staged — include them? [y/N] (default No).
  • Keep the current "commit everything" behavior behind an explicit --all / :all opt-in for those who rely on it.

Files

  • The mr preset / push-and-create-mr.sh wrapper — the git add step before push.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions