merge-fold: a stacked piece replays its already-folded parent, and the smoke record prints a false error

Open
#2,900 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, shell
Domain
tooling

Research direction

Start with .claude/skills/merge-fold/fold.sh, especially the commit selection near line 87 and the smoke record count near line 337. Build the three repository cases in the issue’s scratch harness and confirm the commit list, already-folded case, and missing-file stderr behavior; then remove the filter to verify the mutant makes case (a) fail. Done means the harness records those results and a fresh reviewer gives a MERGE verdict before the fix is folded as a TOOLS change.

Written by the indexing model from the issue text.

Description

Evidence at eeb31e8677b79d43a38156cc3feec82b1e1c819e

What the release tree says, read at the release tip:

  • .claude/skills/merge-fold/fold.sh:87: COMMITS=$(git -C "$REL" rev-list --reverse "$PREV..$TIP"). The fold replays every
    commit between the release tip and the piece tip. It does not drop a commit whose patch is already on the release line.
  • .claude/skills/merge-fold/fold.sh:337: NAT_FROM=$(( $(wc -l < "$D/smoke-native-unit.txt" 2>/dev/null || echo 0) + 1 )).
    The 2>/dev/null comes after the < redirect, so the shell prints the missing-file error before the suppression applies, on every
    run where the record file does not exist yet.

Measured in the batch records (work root, not in the repository):

  • Batch 229 (piece fe99a482a, the observe seam B0, whose parent 568f97b04 the release already holds as df85c48a3): the
    fold log reads piece commits, oldest first: 568f97b04... fe99a482a.... The pick of 568f97b04 came out empty
    (cherry-pick.txt: "The previous cherry-pick is now empty"), and the fold stopped mid-pick. The batch was aborted, clean.
  • git cherry release/v6.20.0 fe99a482a at eeb31e867 prints - 568f97b0413920ce8d9545da9b99ceb75fb47692 (already present)
    and + fe99a482a246cb7297a7b7f17225ceb74e36275c (new).
  • The same holds for the next stacked piece: git cherry release/v6.20.0 553aab7d510135b115591642d0c72218af7a72da prints
    - 88df112500dfec9b01a1abde8a866deb574cf624 (unit 1 of #2894, folded as 4df1a76ac) and + 553aab7d5....

Not shown

  • Whether a fold whose whole piece is already on the release is meant to pass or stop. The harness below decides the
    case by what the release line holds, not by an assumption.
  • The early class check (fold.sh, piece_class over PREV...TIP) reads the parent's changes too. It is conservative (a
    class can only come out as more-gated), and it is not changed here. The check on the replay reads PREV...HEAD, which is exact.
  • Whether any other open piece is stacked on an already-folded parent beyond the observe stack (fe99a482a, 290ff11fd,
    27a498bad, b1ec3b5b5) and 553aab7d5.

Falsifier

At eeb31e867, a fold of fe99a482a alone, with the script as it stands, lists one commit in piece commits, oldest first.
The fold log of batch 229 shows two (568f97b04 and fe99a482a), so this issue is wrong if the one-commit listing appears.

Work

Test first, each item with what it must show:

  1. A scratch harness (its output recorded in the commit; fold.sh has no test harness). It builds three small repositories:
    (a) a stacked piece whose parent is already on the release line by an equal patch: the commit list must be the piece alone;
    (b) a piece with nothing on the release line: the commit list must be every commit, unchanged;
    (c) a piece every commit of which is already on the release line: the fold must stop with a message that says so.
    Case (a) fails on the current code (it lists the parent).
  2. fold.sh: the commit list keeps only the commits that git cherry release/v6.20.0 <tip> marks +, in rev-list order. The
    function is bracketed by markers so the harness can run it unchanged.
  3. fold.sh: 2>/dev/null moves before the < redirect on the line that counts the record lines. The harness shows that a
    missing record file prints nothing on stderr and counts as zero.
  4. Mutant proof: remove the filter in step 2 and show that case (a) fails, with the output pasted, then restore.
  5. A fresh review of the change (a reviewer that did not write it), a MERGE verdict on the tip, then the fold of the fix as a
    TOOLS change. Then the stacked pieces fold in order, each as its own batch.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.