gitsigns.nvim
gitsigns.nvim copied to clipboard
Show staged and unpushed changes
Is your feature request related to a problem? Please describe. It would be nice if we could also see the changes that are staged but not yet committed, and the changes that have not yet been pushed to the remote branch that the current branch is tracking.
Describe the solution you'd like We could add more signs in an additional sign column:
-
staged
for changes ingit diff --staged
-
unpushed
for changes that have been committed but are not yet pushed to the tracked branch, similar to setting thebase
to@{upstream}
.
Or alternatively allow the user to configure multiple bases with a custom git diff command.
Describe alternatives you've considered
- staged: It doesn't look like this is possible by changing the
base
option. - unpushed: Setting
base = "@{upstream}"
can show unpushed changes but then you can't differentiate between unstaged code and committed code. Settingbase = "HEAD..@{upstream}"
can show unpushed commits but then you can't see unstaged code.
yes, git diff --staged
is what I need as well
Gitsigns already seems to have support for showing staged changes, but I can't seem to get it to work... is it still experimental?
Try _signs_staged_enable = true
.
It should show staged hunks in a dimmer color.
@lewis6991 For some reason, it doesn't work for me. A sign simply disappears after the stage. Is there anything else is required to make it work?
No, not really. There could be a bug.
Why does the _signs_staged_enable
start with an underscore? To me that would signal that it is not intended to be used publicly in that way, and/or it is experimental?
Yes, that is correct. It is still experimental and hence is not documented. That is why this issue is still open.
@lewis6991 _signs_staged_enable
works great for me. Thanks so much. This is one of my favorite plugins!
Resolved with #1039