Problem
When opening a merge commit in Neogit's commit view, the displayed diff uses Git's default merge diff behavior.
For merge commits, this is often not the most useful view when reviewing history on the main branch. In practice, I would expect the commit view to show the changes introduced to the first parent (mainline), i.e. the equivalent of:
git show --diff-merges=first-parent <merge-commit>
instead of the default combined merge diff.
Why this is confusing
For a merge commit on master or main, the most natural review question is usually:
"What did this merge introduce to the main branch?"
That corresponds to diffing the merge commit against its first parent.
The current behavior makes merge commits harder to read, because the combined diff mixes both parents and can make the result feel like it is biased toward the merged branch instead of the target branch.
Example
Suppose master has a merge commit like:
- first parent:
master
- second parent:
feat/modify-a
In commit view, I would expect Neogit to show the diff relative to the first parent (master), not the default combined merge diff.
Expected behavior
One of these would solve the issue:
- Use first-parent diff in commit view for merge commits by default.
- Add a configuration option for commit view merge diff strategy, for example:
- default / combined
- first-parent
Possible implementation direction
It looks like commit view currently builds its contents from git show <commit> and git show --stat <commit>.
For merge commits, using --diff-merges=first-parent would make the view align better with mainline history review.
Environment
- Neovim:
NVIM v0.11.6
- Neogit:
e0674522
- Git:
git version 2.53.0
Problem
When opening a merge commit in Neogit's commit view, the displayed diff uses Git's default merge diff behavior.
For merge commits, this is often not the most useful view when reviewing history on the main branch. In practice, I would expect the commit view to show the changes introduced to the first parent (mainline), i.e. the equivalent of:
git show --diff-merges=first-parent <merge-commit>instead of the default combined merge diff.
Why this is confusing
For a merge commit on
masterormain, the most natural review question is usually:"What did this merge introduce to the main branch?"
That corresponds to diffing the merge commit against its first parent.
The current behavior makes merge commits harder to read, because the combined diff mixes both parents and can make the result feel like it is biased toward the merged branch instead of the target branch.
Example
Suppose
masterhas a merge commit like:masterfeat/modify-aIn commit view, I would expect Neogit to show the diff relative to the first parent (
master), not the default combined merge diff.Expected behavior
One of these would solve the issue:
Possible implementation direction
It looks like commit view currently builds its contents from
git show <commit>andgit show --stat <commit>.For merge commits, using
--diff-merges=first-parentwould make the view align better with mainline history review.Environment
NVIM v0.11.6e0674522git version 2.53.0