Skip to content

New git glyph option: 'added' #2685

@cheeze2000

Description

@cheeze2000

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

Activity

alex-courtis

alex-courtis commented on Feb 25, 2024

@alex-courtis
Member

Works for me! That would be most useful.

Any other tweaks in the git decorator would be most gratefully appreciated.

added
QOLQuality Of Life Improvement
PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciated
on Feb 25, 2024
mohamedarish

mohamedarish commented on Feb 27, 2024

@mohamedarish
Contributor

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?

alex-courtis

alex-courtis commented on Mar 1, 2024

@alex-courtis
Member

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
mohamedarish

mohamedarish commented on Mar 3, 2024

@mohamedarish
Contributor

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.

cheeze2000

cheeze2000 commented on Mar 3, 2024

@cheeze2000
Author

@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).

mohamedarish

mohamedarish commented on Mar 4, 2024

@mohamedarish
Contributor

As I said, isn't that already implemented using git.untracked and git.unstaged

cheeze2000

cheeze2000 commented on Mar 4, 2024

@cheeze2000
Author

@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".

alex-courtis

alex-courtis commented on Aug 10, 2025

@alex-courtis
Member

This looks to be resolved by #3176

added a commit that references this issue on Aug 10, 2025
0a52012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedQOLQuality Of Life Improvementfeature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @alex-courtis@cheeze2000@mohamedarish

      Issue actions

        New git glyph option: 'added' · Issue #2685 · nvim-tree/nvim-tree.lua