-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Git diff/patch-view UX: Better UI for seeing all patches, staging and discarding selected hunks/lines #43887
Comments
I need to agree with @madig here. Atom's Git UX is IMHO way better and I would like to see a similar improved UX in VSCode. I think the UX differences and thus proposed features should be enumerated for better tracking:
I think all of these features would be able to live in parallel our in addition behind a setting in the current UI, in case the existing experience should be preserved. |
Since I never |
I agree, if the VSCode Git diff view could have the ability to detect and display hunks, along with contextual actions for said hunks (i.e. stage, revert) my git workflow would be vastly improved. Currently I have to select lines manually with a mouse to stage a "hunk", which is getting quite tedious. |
This would be extraordinarily useful. Right now, I just keep a copy of GitHub Desktop open for this view. |
Agree atom Git pane significantly easier to use. Would be awesome if you can action button to stage/revert change similar to atom. |
Described UI improvements would be great. Please note that VSCode supports editing in the diff view - we find this feature extremely useful. |
Agree with all of the above, the diff view could be so much more powerful. Being able to revert hunks (or even select and copy removed code, why is that disabled?) would be extremely useful and is the major thing I miss from PyCharm. |
is there any ability to stage hunk from diff view? it seems like the feature already exists in the regular editor mode (by clicking the gutter indicating diffs) but i can't seem to activate it from the diff view |
@timdeng2324 Yes, by right-clicking on newly added or selected lines and "Stage selected ranges". To stage deleted hunks, you unintuitively need to right-click the line above the grayed out area. This was added last year in #43941, but evidently it is too hard to discover. Your confusion is why #26067 should be implemented. @tunnij You can copy deleted code in side-by-side view, but I agree that it should be possible in inline view as well. |
Best keyboard-based UI for navigating, staging, unstaging, discarding hunks and lines. The reason Sublime is still open next to VSCode. |
The stage/unstage selection works quite well, but sometimes it gets confused. I think this happens when there are series of additions, deletions and additions in series. I wanted to unstage the final addition, but couldn't in VS Code. Running git gui clearly showed the hunk and allowed me to unstage just that hunk. So a hunk based diff can be very useful. |
I strongly recommend the tool [Fork], for those who want to have a finer control of the hunk&line level staging. And for Java programmers, I am developing a semi-automatic tool called [SmartCommit] to group related hunks together through program analysis, which looks like: |
It will be nice if the actions of the hunks will use code lenses |
Just adding my interest in this feature as well - vscode implementation of staging hunks and showing the full code is a bit clumsy. I much prefer the way other Git GUIs do it with a dedicated Stage Hunk button and show the context of the diff. Staging 6 hunks in e.g. SourceTree or Gitkraken takes 6 clicks. In vscode it takes double with 12 clicks because you have to click "..." or the sidebar, then stage hunk. |
My twopence here too, as far as I know, Gitkraken nailed it with the It can be seen more in detail on this (not mine, their own demo) youtube link https://www.youtube.com/watch?v=R1iWJNyRpQE What I like about it is the capability of adding single lines and removing them from the result/bottom view if you make mistakes on the merge process. Reading the previous comments, I think @Symbolk suggestion, https://git-fork.com/, seems to be similar (if not identical) solution. I'll try that one now but I'd love to see this functionality on vscode to avoid having to open – yet another app – when I have to face a hairy merge conflict. |
I'm just dropping this here, way more useful than all the other plug-ins |
To add another Git UX Client comparison than will be nice to add to VSCode : Eclipse IDE has the most powerful git staging editor in the market (eGit). Local file diff is compared vs the stage area, any hunk can be added to the staging area or overwritten (to rollback local hunk) with left / right arrows in the vertical separator of the diff, but better than git kraken, source tree etc : you are free to directly edit the staging area to better split the prepared commit. Example -2019 - Company A
-2019 - Company B
+2021 - Company A
+2021 - Company C But I want to separate in two commits : -2019 - Company A
-2019 - Company B
+2021 - Company A
+2021 - Company B Commit 2 : Update company B to company C -2021 - Company B
+2021 - Company C In that case, choosing the full hunk in not enough ( |
I love vscode, but I really miss the diff/hunk editor view in Atom when staging commits. (or even gitkraken) Please expose top-level(not in context menu) stage/revert/unstage links/buttons to hunks in the diff view🙏🙏 (super bonus points if it could also have an option to show just the hunks.. like Atom) |
This request is quite old... how do we get it on their radar? |
I don't know, but would love this feature. |
Now that VSCode is exploring a merge editor #146091 hopefully they will explore also a better diff/patch-view 😃 , making VSCode hunk aware. The 2 issues might relate on some concerns. |
Just to add some keywords to this ticket as I struggled to find it initially. Hopefully these will bring visibility to this ticket I searched for |
Actually, this should be |
Quickly staging a hunk or a selection with just a single click was just implemented in #206808 Since I'm neither the OP nor a maintainer of this repository I cannot close this issue (and am not sure if it should get closed), so this is meant to notify all the people interested in this issue that there is news. |
Issue Type
Feature Request
Description
Hi all,
I find Atom's Git pane significantly easier to use. See how it lists all hunks at once and allows me to intuitively select whole hunks or lines to stage or discard (note how the button label changed in the "stage" button in the first hunk). I think VS Code can be improved a lot by reviewing the git UX.
VS Code Info
VS Code version: Code 1.20.1 (f88bbf9, 2018-02-13T15:31:21.019Z)
OS version: Linux x64 4.15.3-300.fc27.x86_64
The text was updated successfully, but these errors were encountered: