Closed wookayin closed 1 year ago
:[0-3]
are not just arbitrary internal identifiers. These are stage numbers in git. Stage 0 refers to the changes currently in the index (things you're about to commit). During a merge or rebase, the stage numbers 1-3 refer to the following versions of a file:
Diffview uses stage numbers to describe git objects when it's appropriate. Otherwise the commit SHA is used. Fugitive does this very similarly. It also uses stage numbers when showing 3-way diffs during a merge.
I understand that it can be a bit frustrating at first remembering what version of a file is displayed on what side during a conflict. But like you've pointed out, diffview is following the convention here (it's the same layout as in vimdiff
and several IDE's). Look to the diagrams under :h diffview-conflict-versions
when you get confused, and then I believe it shouldn't take too long to get used to the layout.
Closing due to no follow-up from OP.
Hi, thanks for the awesome plugin! It would be great if we can improve the bufname of diffview buffers.
Currently, bufname for diffview buffers would look like:
Here
:2:
,:3:
would have no meaning other than internal identifiers. I think we can improve to make them to include more information like SHA-1 hash, or contextual information (e.g.,ours
,theirs
in git conflicts) look like:or
Motivation: For example, in the following 3-way diff:
I am often confused whether the revision shown either in the left or right is
ours
ortheirs
. Per convention and:help diffview-conflict-versions
, the left seems to beours
and the right seems to betheirs
(I'm using thediff3_vertical
layout). But it'd be nice this can be easily told from the buffer names.This also applies to in normal diffview mode (no conflicts). In contrast, fugitive has some nice bufname when looking at diff, for instance: