mhutchie / vscode-git-graph

View a Git Graph of your repository in Visual Studio Code, and easily perform Git actions from the graph.
https://marketplace.visualstudio.com/items?itemName=mhutchie.git-graph
Other
2k stars 264 forks source link

Break "Uncommitted Changes" into "Working Tree" and "Staged Changes" #575

Open aidedinertial opened 3 years ago

aidedinertial commented 3 years ago

Describe the improvement that you'd like

I want to see the difference between the working tree and the commit index directly from Git Graph.

Current workaround is to use the Source Control pane to view staged changes.

Additional context (optional)

image

The current view for "Uncommitted Changes" corresponds to "git diff HEAD"

image

Improvement is to show "Uncommitted Changes" as two circles on top of HEAD

  1. "Working Tree" (git diff)
  2. "Staged Changes" (git diff --cached)

image

and as files/ patches are staged:

image

bminerd commented 3 years ago

+1

aidedinertial commented 3 years ago

@mhutchie Some additional context:

I typically stage only parts of a file at a time. Using Git Graph "Uncommitted Changes" to open the diff is great, but the diff does not update as I stage selected ranges. This is because the diff is against HEAD, not the commit index.

I find myself needing to use other tools (e.g., lazygit) to make commits with partial file staging. It would be incredibly helpful to open a diff versus the commit index, instead of HEAD, so that blocks disappear from the file diff as they are staged.