Commit d116a18
committed
Move conflicted commit detection from headers to commit message markers
The `gitbutler-conflicted` extra header is stripped when commits are
rebased outside of GitButler, silently losing conflict state. Replace
it with commit message markers that survive rebasing and are visible
to developers in `git log`:
- A `[conflict] ` prefix on the subject line for fast visual
detection
- A `GitButler-Conflict:` multi-line git trailer whose value
explains the conflict tree layout
Using a standard git trailer means the description is embedded as the
trailer value with indented continuation lines, so
`git interpret-trailers` and other standard tools can parse and
manipulate it. The resulting commit message looks like:
[conflict] <original subject>
<original body>
<existing trailers, if any>
GitButler-Conflict: This is a GitButler-managed conflicted
commit. Files are auto-resolved using the "ours" side.
The commit tree contains additional directories:
.conflict-side-0 — our tree
.conflict-side-1 — their tree
...
To manually resolve, check out this commit, remove the
directories listed above, resolve the conflicts, and
amend the commit.
The trailer is appended after any existing trailers in the message,
preserving Change-Id, Signed-off-by, and similar lines. When stripping
conflict markers (on resolution, display, or commit matching), the
prefix, trailer, and all continuation lines are removed to restore the
original message.
New commits only write message markers (no header). Reading checks the
message first, then falls back to the header for backward compatibility
with existing conflicted commits.
The CONFLICT-README.txt tree blob is removed since the trailer now
serves the same explanatory purpose with better visibility.
The conflicted file count (`Option<u64>`) stored in the old header was
only ever used as a boolean, so the new approach uses a simple presence
check with no count.1 parent a14ae43 commit d116a18
21 files changed
Lines changed: 671 additions & 148 deletions
File tree
- crates
- but-core
- src
- tests/fixtures/scenario
- but-rebase
- src
- graph_rebase
- tests/rebase
- graph_rebase
- but-workspace
- src
- legacy
- ui
- tests/workspace/commit
- but-worktrees/tests/worktree
- but/tests/but/command
- gitbutler-branch-actions/tests/branch-actions
- gitbutler-commit/src
- gitbutler-edit-mode/src
- gitbutler-repo/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
0 commit comments