Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show staged and unpushed changes #775

Open
rolag opened this issue Mar 30, 2023 · 8 comments
Open

Show staged and unpushed changes #775

rolag opened this issue Mar 30, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@rolag
Copy link

rolag commented Mar 30, 2023

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 rolag added the enhancement New feature or request label Mar 30, 2023
@halshar
Copy link

halshar commented Apr 16, 2023

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

@no-more-secrets
Copy link

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

@lewis6991
Copy link
Owner

Try _signs_staged_enable = true.

It should show staged hunks in a dimmer color.

image

@alex35mil
Copy link

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

@lewis6991
Copy link
Owner

No, not really. There could be a bug.

@no-more-secrets
Copy link

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?

@lewis6991
Copy link
Owner

lewis6991 commented Jun 19, 2023

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

@samerickson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants