Skip to content

Commit d081a27

Browse files
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 5cba81d commit d081a27

21 files changed

Lines changed: 688 additions & 149 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,4 @@ gix-merge = { opt-level = 3, debug-assertions = false }
359359
[profile.release.package.but-installer]
360360
opt-level = "z" # Optimize for size instead of speed
361361
strip = true # Strip symbols from binary
362+

0 commit comments

Comments
 (0)