nvim-tree.lua
nvim-tree.lua copied to clipboard
New git glyph option: 'added'
Is this a question? No.
Can this functionality be implemented utilising API? No, I think.
Is your feature request related to a problem? Please describe. Files that are added to the index are treated the same way as if they are staged. I linked the source code below that is responsible for this behaviour.
Describe the solution you'd like Separate the two cases together by adding a new git glyph option, 'added'.
Describe alternatives you've considered None.
Additional context Relevant source code
Works for me! That would be most useful.
Any other tweaks in the git decorator would be most gratefully appreciated.
Please describe.** Files that are added to the index are treated the same way as if they are staged. I linked the source code below that is responsible for this behaviour.
Isn't the git index the same as staging area? We add files to the index/staging area using git add
?
Quoting the git book
The staging area is a file, generally contained in your Git directory, that stores information about what will go into your next commit. Its technical name in Git parlance is the “index”, but the phrase “staging area” works just as well.
Is there a difference?
Is there a difference?
Git does still recognise them as different until you commit. In this case README change is staged and added
has been added:
: ; git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: README
new file: added
: ; git status --porcelain=v1
M README
A added
The example you stated shows how git differentiated a modified file and a new file being added.
The issue is for indexed/staged.
indexed and staged are the same thing from what I know.
The plugin already differentiates new file and modified file using untracked
and unstaged
.
@mohamedarish What Alex showed is correct and is what I meant. Git Status treats "new file added" vs "file modified" differently. It's unnecessary to go into minute details as long as I can get the message across (which I did).
As I said, isn't that already implemented using git.untracked
and git.unstaged
@mohamedarish The issue concerns files that are staged or added to the index. I'm not talking about untracked or unstaged. The XY path of adding an untracked file to the index is "A "
, which is treated as "staged".