vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Option to view diffs for many files in a single editor tab.

Open rattrayalex-stripe opened this issue 6 years ago • 13 comments

Coming from https://github.com/eamodio/vscode-gitlens/issues/389#issuecomment-395540273

I would like to be able to view the diff output of many files in a single editor tab, ideally in side-by-side mode.

For example, if I execute a codemod or find/replace across 100 files, I would like a single tab through which to scroll to verify my changes. For this purpose, I actually quite like the side-by-side view in VSCode. Currently, I use old-school git diff which is fine but not as nice.

If Gitlens/VSCode's diff viewer were usable for any arbitrary diff, I imagine this would be a trivial add-on.

rattrayalex-stripe avatar Jun 07 '18 19:06 rattrayalex-stripe

FYI, vscode built-in diff view is usable as an arbitrary diff

eamodio avatar Jun 07 '18 19:06 eamodio

oh, how?

rattrayalex-stripe avatar Jun 08 '18 02:06 rattrayalex-stripe

Sorry I meant from inside an extension.

eamodio avatar Jun 08 '18 03:06 eamodio

Gotcha; this implies that GitLens could indeed build this feature, correct? Would you be interested in that?

rattrayalex-stripe avatar Jun 09 '18 00:06 rattrayalex-stripe

Yup, exactly. I definitely do think it is quite interesting, but I can't promise anything about when I might get around to it ;)

But if someone else wants to take it on, I would certainly be willing to collaborate.

eamodio avatar Jun 09 '18 01:06 eamodio

I think it would be nice at least to add setting that will force VS Code to open new Git diff tab only if none diff tabs are opened and replace diff tab otherwise. The problem is that I want this behavior only for Git diffs but not for editor tabs.

alexeychikk avatar Jan 27 '19 12:01 alexeychikk

I'd expect that when pressing right mouse button over "GitLens view -> REPOSITORIES section -> branch -> commit" or over "GitLens view -> SEARCH COMMITS -> commit" the context menu would contain "show side-by-side diff of all changes".

Also, a config entry for "lines of context" just like in gitk tool.

So the difference between gitk and GitLens would be the side-by-side diff.

tojamrok avatar Jun 06 '19 09:06 tojamrok

This feature is specially interesting to review your staged code changes before you commit. I fell I am committing blindly if I can't scroll down through all my changes.

It is a common feature present in tools like GitHub, gitk, and even command line "git diff".

lvella avatar Nov 01 '20 16:11 lvella

Yes, I would definitely like this feature too. But this isn't something that I will likely add myself anytime soon, but if the community wants to champion it and provide a PR (after discussions) I'm certainly open to it -- of course, depending on the complexity and scope of the changes required.

eamodio avatar Nov 02 '20 22:11 eamodio

Maybe add two more button in changes view will work. image

zzjin avatar Apr 20 '21 06:04 zzjin

For some inspiration, this is implemented in edamagit - relevant code:

The-Compiler avatar Jun 28 '21 16:06 The-Compiler

Hi! I'm here because of Github sunsetting Atom. This feature is something I'm missing very much now after trying VS Code for a couple of days. I'm surprised there isn't more demand for this. Are people actually clicking through the individual files and scrolling through them to see all changes?

While I do use the features to check individual file diffs, history and so on occasionally, it is way more common for me to want a quick look at what a particular commit is doing across all files. In Atom, this is a single click operation: click the commit and the diff of this opens in the current pane. It is very similar to git show or a PR diff. Only a few lines around the changes are visible.

As a comparison, in VS Code with Git Lens, the single click only unfolds the commit to view what files changed. Then one has to click through the files to see what changed in each of them. (And the full file is visible so you also have to scroll through it completely to make sure you see all changes.)

I realize there isn't a great chance this will be prioritized just because of my comment here, but please consider that there are now Atom users out there looking for alternatives. The git integration was the main reason I stuck with Atom instead of switching to VS Code. Now I find myself forced to move. Most things in VS Code work better/faster, but since I'm working a lot with git, I find that this missing feature is a big pain.

lentzi90 avatar Jun 13 '22 10:06 lentzi90

I haven't used the Atom implementation of this, but I can say that I really really liked the way magit does it.

neongreen avatar Jun 13 '22 17:06 neongreen

Thanks for spotting that @lentzi90 !

If anyone is interested, I've published an extension Whole Diff that covers this, I think.

jacekkopecky avatar Oct 18 '22 07:10 jacekkopecky

Thanks @jacekkopecky, that's a really useful extension!

carlfriedrich avatar Oct 24 '22 07:10 carlfriedrich

Looks like vscode team is working on that https://github.com/microsoft/vscode/issues/179000

Igorgro avatar Aug 06 '23 07:08 Igorgro