Skip to content

edit-mode: upon enter, modify commit consistently#13344

Merged
jonathantanmy2 merged 1 commit intomasterfrom
jt/editconflict
Apr 16, 2026
Merged

edit-mode: upon enter, modify commit consistently#13344
jonathantanmy2 merged 1 commit intomasterfrom
jt/editconflict

Conversation

@jonathantanmy2
Copy link
Copy Markdown
Collaborator

@jonathantanmy2 jonathantanmy2 commented Apr 16, 2026

Why I'm not automerging: need a product decision (whether going with what's in this PR, the "alternative design choice" described below, or something else).

This is a follow-up from #13247 (comment) (that link is what's provided by GitHub but it doesn't work as it links to a resolved comment; it's a comment on crates/gitbutler-edit-mode/src/lib.rs). The problem description by chatgpt-codex-connector is correct, and upon investigation, the problem is a bit more than described. This PR fixes everything I've seen in my investigation.


There are currently some bugs and inconsistencies with how edit mode is
entered. In particular:

  • all extra headers are cleared (not only the one that represents
    conflicts)
  • the conflict marker in the commit message title is not cleared, even
    though (as stated in the previous bullet point) the conflict extra
    header is cleared

Therefore, preserve all other extra headers, and clear the conflict
marker in the commit message title. This allows us to remove the
corresponding code that is run upon exiting edit mode, so remove that
too.

An alternative design choice would be:

  1. not clear any extra headers or conflict markers in the commit
    message title upon entering edit mode
  2. clear the conflict extra header and the conflict marker in the
    commit message title upon exiting edit mode

This is closer to the status quo, in which we do 2) but not 1). But I
think this is less user-friendly, as the user cannot see exactly what
commit is going to be committed.

@github-actions github-actions bot added the rust Pull requests that update Rust code label Apr 16, 2026
There are currently some bugs and inconsistencies with how edit mode is
entered. In particular:
 - all extra headers are cleared (not only the one that represents
   conflicts)
 - the conflict marker in the commit message title is not cleared, even
   though (as stated in the previous bullet point) the conflict extra
   header is cleared

Therefore, preserve all other extra headers, and clear the conflict
marker in the commit message title. This allows us to remove the
corresponding code that is run upon exiting edit mode, so remove that
too.

An alternative design choice would be:
 1) not clear any extra headers or conflict markers in the commit
    message title upon entering edit mode
 2) clear the conflict extra header and the conflict marker in the
    commit message title upon exiting edit mode

This is closer to the status quo, in which we do 2) but not 1). But I
think this is less user-friendly, as the user cannot see exactly what
commit is going to be committed.
@jonathantanmy2 jonathantanmy2 changed the title commit message wip edit-mode: upon enter, modify commit consistently Apr 16, 2026
@jonathantanmy2 jonathantanmy2 marked this pull request as ready for review April 16, 2026 18:10
@jonathantanmy2 jonathantanmy2 merged commit 7d63b97 into master Apr 16, 2026
35 of 36 checks passed
@jonathantanmy2 jonathantanmy2 deleted the jt/editconflict branch April 16, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants