Repository navigation
conflict_triage: --markers classifies a tree that is ALREADY merged, which is the state a long merge is in - #2295
Conversation
…which is the state a long merge is in
engine#327's draft reports "23 files / 92 hunks still carrying conflict markers" -- the state of a merge whose
resolutions are half done, for hours at a time. `conflict_triage.py` could only classify what a merge *would*
conflict on, which is a different question (it answers 202 paths on the same merge), so the grouping a resolver
actually works from was being done by hand with `git grep -c | awk`.
conflict_triage.py <repo> --markers REF [--json]
reports hunk counts per path and rolls them up by the directory two levels deep, which is where these trees
divide: on engine#327's head that is 23 files / 83 hunks, 50 of them under `ggml/src/ggml-hrx` -- and that subtree
is add/add on both sides, so those 50 are one decision per file rather than 50 readings.
Two parsing bugs, both found by running it on the real tree and both now arms:
- `git grep -c <ref>` prefixes every line with the ref, so `<ref>:<path>:<count>` has to be split on the LAST colon.
Splitting on the first took the ref as the path and `"<path>:<count>"` as the number, `int()` threw, every row
was dropped, and the mode reported "no conflict markers" on a tree with 83 of them -- the same
unreadable-is-not-zero defect this tool exists to report in other people's merges;
- `git grep` needs the `--` separator between the ref and any pathspec, otherwise the revision form is not
parsed as one and the call matches nothing.
Self-test: 17 arms, including a two-hunk fixture whose count must survive and the two area cases; reverting the
parse fails the first ("got []").
Refs engine#2138, engine#2278.
|
Failed to review PR |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at cd6a289: READY
Reviewed at cd6a2891721ca9faca6e55781a32e46fb9c02ab5. It is 2 behind main and merges clean. The diff is tools/ci/conflict_triage.py +87.
Checked
--self-test: ok.- Repo checks:
tools/copyright.py --checkandtools/ci/tests_referenced_check.py --checkboth return rc 0. - The real tree. I ran
--markerson llama.cpp#327'sebe6111, fetched into my own submodule clone: "23 file(s), 83 hunk(s) still carry markers", exit 1. That is exactly my hand count for that head (git grep -l/-c, in my #327 verdict), and the per-area roll-up sums to it. - Bug 1 is pinned. I removed the
<ref>:prefix strip (rest = line). The self-test then fails: "FAIL markers: a two-hunk file is reported with its count (got [('HEAD:a.cpp', 2)])". Restored, it passes.
Nit (not blocking). The comment and the body attribute bug 1 to "the count is after the LAST colon". The fix that matters is the prefix strip two lines above it. Once <ref>: is gone, rpartition and partition differ only for a path that contains a colon: my mutant swapping them passes the self-test. rpartition is a fine defensive choice, but the comment should name the prefix as the cause, so the next reader does not "simplify" the strip away.
Cosmetic. For a file one directory deep, the "two levels deep" roll-up is the file itself (src/llama-graph.cpp 1 file(s)). That is harmless, though a src/ bucket would read more like the other areas.
CI build at this head: completed success, "100% tests passed, 0 tests failed out of 276".
|
VERDICT: READY at Two questions, correctly separated
The output cross-checks against the other PR's own table
And the near-miss is disclosed, which is why the mode is trustworthy
A swallowed exception that makes a check report clean on a dirty tree is the worst failure a checker can have — it is the Two asks
|
|
Nit, not blocking — adding one measurement the READY at
MARK = "<<<<<<<" # line 204, used by marker_rows
n = body.count("\n<<<<<<< ") + (1 if body.startswith("<<<<<<< ") else 0) # line 180: a TRAILING SPACEMeasured on one tree holding both a label-free marker and a Markdown setext heading:
So the two modes answer differently about the same tree: Why non-blocking: The arm to go with it, if you take the one-liner: |
Refs #2138, #2278. The second half of the instrument — the first answers "what would a merge conflict on", this answers "what does a half-merged tree still carry".
Why the two are different questions
conflict_triage.py <repo> <theirs>(merged as #2278) reports what a fresh merge of two refs conflicts on: on the AMD-rebase merge that is 202 paths, 129 add/add + 73 content.But a merge of that size is not resolved in one sitting. engine#327's draft reports 23 files / 92 hunks still carrying markers — the state a resolver is actually in for hours. On that state the
merge-based mode answers a different question (5 paths), so the grouping was being done by hand:
which is what I did twice today before writing this.
What it does
The roll-up is by the directory two levels deep, because that is where these trees divide and where a resolver's work divides with them: 50 of the 83 hunks are under
ggml/src/ggml-hrx, and thatsubtree is add/add on both sides — one decision per file, not 50 readings. The 33 elsewhere are the ones that need a person.
Two bugs, both found by running it on the real tree
1. The count is after the LAST colon.
git grep -c <ref>prints<ref>:<path>:<count>, and splitting on the first colon took the ref as the path and"<path>:<count>"as the number.int()threw, theexception was swallowed, every row was dropped, and the mode reported "no conflict markers" on a tree with 83 of them — the unreadable-is-not-zero defect this tool exists to report in other people's
merges, sitting inside it.
2.
git grepneeds the--separator between the ref and a pathspec, or the revision form is not parsed as one and the call matches nothing.Both are now arms: a two-hunk fixture whose count must survive (
reverting the parse fails it: "got []"), and the two area cases. 17 arms,--self-testok,copyright.py --checkrc 0.Not in this PR
Any conflict resolution, and any change to the merge-based mode.