gitsigns.nvim icon indicating copy to clipboard operation
gitsigns.nvim copied to clipboard

Show staged and unpushed changes

Open rolag opened this issue 1 year ago • 8 comments

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:

  1. staged for changes in git diff --staged
  2. unpushed for changes that have been committed but are not yet pushed to the tracked branch, similar to setting the base to @{upstream}.

Or alternatively allow the user to configure multiple bases with a custom git diff command.

Describe alternatives you've considered

  1. staged: It doesn't look like this is possible by changing the base option.
  2. unpushed: Setting base = "@{upstream}" can show unpushed changes but then you can't differentiate between unstaged code and committed code. Setting base = "HEAD..@{upstream}" can show unpushed commits but then you can't see unstaged code.

rolag avatar Mar 30 '23 17:03 rolag

yes, git diff --staged is what I need as well

halshar avatar Apr 16 '23 17:04 halshar

Gitsigns already seems to have support for showing staged changes, but I can't seem to get it to work... is it still experimental?

no-more-secrets avatar Jun 11 '23 19:06 no-more-secrets

Try _signs_staged_enable = true.

It should show staged hunks in a dimmer color.

image

lewis6991 avatar Jun 13 '23 14:06 lewis6991

@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?

alex35mil avatar Jun 19 '23 10:06 alex35mil

No, not really. There could be a bug.

lewis6991 avatar Jun 19 '23 10:06 lewis6991

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?

no-more-secrets avatar Jun 19 '23 11:06 no-more-secrets

Yes, that is correct. It is still experimental and hence is not documented. That is why this issue is still open.

lewis6991 avatar Jun 19 '23 11:06 lewis6991

@lewis6991 _signs_staged_enable works great for me. Thanks so much. This is one of my favorite plugins!

samerickson avatar Aug 03 '23 00:08 samerickson

Resolved with #1039

lewis6991 avatar Jun 13 '24 14:06 lewis6991