Skip to content

Merge window: auto-merged lines, autostash pull, rebase titles - #13

Merged
leafOfTree merged 5 commits into
masterfrom
dev-merge-2
Oct 28, 2026
Merged

leafOfTree merged 5 commits into
masterfrom
dev-merge-2

Conversation

@leafOfTree

Copy link
Copy Markdown
Owner

Summary

Follow-ups to the merge window from #12.

  • Lines git merged on its own: lines changed on only one side, which git merges without a conflict, now show in grey (ProjectMergeAuto). They are marked with the side they came from, ◂ yours or ▸ theirs, in the result pane and on that side. Before, they looked like lines nobody had touched. To find them, the merged text is diffed against the base, and the diff of yours against the base tells whose change each line is.
  • Pull keeps local changes: pull runs git pull --autostash, so uncommitted changes are set aside before the pull and put back after it, like IntelliJ does.
    • If putting them back conflicts with what was pulled, git keeps them in the stash and the merge window opens with your local changes as yours.
    • Once a file is resolved, it is an unstaged local change again.
    • git_pull_autostash turns this off. It needs git 2.27 or newer.
  • Rebase titles: during a rebase HEAD is detached, so the upstream title showed only a hash. The titles now use the branch being rebased and the commit it is rebased onto, both read from what git saves for the rebase.
  • Same keys in the edit window: the edit window (e) now uses q to accept and Q to discard, like the merge window. :w and :q! still work.
    • Once all conflicts are resolved, the status line reads done: q to accept, Q to discard, short enough to fit a narrow pane.

Testing

  • New tests:
    • a real rebase and a real cherry-pick, resolved in the window and then continued;
    • --autostash pull: one case puts the changes back cleanly, the other conflicts and is resolved in the window;
    • which side each auto-merged line came from;
    • q and Q in the edit window.
  • The whole suite passes in Vim 9.1 and Neovim 0.11.6: 144 tests.
  • I also tried the merge window by hand in Neovim. Neovim turned up one bug, now fixed: it refuses to compare v:null with a list.
  • test/demo_merge.sh now includes one auto-merged line from each side.

https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd


Generated by Claude Code

During a rebase HEAD is detached, so the upstream title showed a bare
hash and yours only the commit. Take the branch being rebased and the
commit it is rebased onto from what git saves for the rebase. Tests run
a real rebase and cherry-pick through the window and continue them.

Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
Like IntelliJ, local changes are put aside before pulling and back after
it. When putting them back conflicts, git keeps them in the stash and
the merge window opens with them as yours; once resolved they are local
changes again. git_pull_autostash turns it off.

Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
Changes made on one side only were merged by git without a mark, looking
like lines nobody touched. Diff the base with the merged text to find
them, tell by yours whose change each one is, and mark them grey with
the side they came from. The demo has one such line per side.

Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
The edit window said :w to use it, :q! to cancel while the merge window
said q to accept. Both use the configured accept and discard keys now,
and the status line once resolved says only what to press, to fit.

Claude-Session: https://claude.ai/code/session_01BwofrMkZ4QpGsCYYSgncrd
@leafOfTree
leafOfTree merged commit b207006 into master Oct 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant