Crappy VStudio github integration. Inadequate functionality. Can't compare commit with live files et

Using github/team-explorer with VStudio.

I’m having issues comparing diffs and what not. I want to look at my current files, and compare with ones from a previous commit (the ‘clean base’ version), and then walk through each changed line to verify its stability/neatness/correctness etc.

  1. VStudio doesn’t have an option to compare & edit, just ‘compare 2 previous commits’ for some @@#$ reason.
    Ain’t just me. 3+ years and people have requested a bloody simple ‘feature’. Gaarrgh. No response for 3 years!
    https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/11015487-allow-compare-working-copy-to-historical-version

  2. The list of changes is not filterable by git status, (e.g. I dont care about added files only edited ones etc.), and is not even bloody expandable! This has, also, been requested.

  3. Right clicking on a file in the change list and selecting ‘Open’ opens the temporary, read-only, commit file. Not the ‘current file’. So now I have to open explorer and search for the **bleep** file every @#$ time. Why would I ever open the read-only commit file anyway when left clicking gives me the diff (with said file)…

  4. There are no shortcuts to go to next diff’d file, or a way to ‘check off’ files that I’ve already looked through. It also doesn’t save state, so every time I open up VStudio I have to compare commits again and again…I can’t even save the history window layout/position.

Please offer any recommendations on a decent VStudio + github work flow, it’s a pain as it is now and I can’t see myself going over a (very large) merge of 100-200+ touched files. (VSCode can’t work as a replacement because it’s not an IDE…)

Or, ya know, ‘add’ these features. At least some of them. This’ll make an unworkable system actually useful.

Besides, Diff CAN compare source with older files, here’s an old (semi-unrelated) link:

https://blogs.msdn.microsoft.com/benwilli/2015/05/29/visual-studio-tip-9-you-can-edit-directly-in-the-diff-tool/

So it’s just a matter of hooking this up the github integration that VStudio has right now.

Otherwise I’m going to have to either
A) Do this all by hand, and add days to the merge because of possible mistakes, repeated diffs, etc.
B) Use a third-party tool of some sort (can’t think of any atm), which’ll waste time too.

[Edited: Added more lacking features and obvious flaws.]

Thanks for reaching out.

From what we can understand by what you describe, it doesn’t appear that you’re using our GitHub extension for Visual Studio, but Microsoft’s own Git integration in Visual Studio. If you’re using GitHub as your source code host, then the GitHub extension we provide may be able to help with some of what you describe, specifically opening files in your solution that have been touched in a GitHub Pull Request, or comparing the file in your local version to the base branch of the Pull Request. Also, because our extension is open source, you can follow along with the development of it or even contribute to it.

You may want to give our extension a try and see if it helps? And let us know if you have any questions.

1 Like

If you use the GitHub Extension for Visual Studio, you can compare a file as it was at the base of a PR with the live file in your working directory. To do this you’d need to select the View Changes in Solution option.

Alternatively you can use the default / View Changes view to show the (non-editable) diff as it appears on GitHub. You can leave comments using the comment margin or right-click on the text and Open File in Solution if you want to edit or navigate using the normal code view.

You can navigate back to the PR diff using a similar command on the code view.

1 Like

How do I see changes from current files as compared to an older commit? ATM I can only find a list of uncommited-changes. Not what I want to check.

Any way to filter by git status?

Any shortcuts available?

I tried the ‘github extension’ but it didn’t offer any of the features I listed. I can probably try to hack up my own solution with your extension at the base but its gonna drain much more time. And besides, I’m not used to creating VStudio extensions XD

> I’m having issues comparing diffs and what not. I want to look at my current files, and compare with ones from a previous commit (the ‘clean base’ version), and then walk through each changed line to verify its stability/neatness/correctness etc.

This sounds very much like the process someone would go through when reviewing a pull request, i.e. they need to compare a pull request branch branch with the branch they’re targeting (typically master). This is something that is supported by the GitHub Extension for Visual Studio.

Could you try doing the following:

  1. Create a pull request from the branch you’re working that targets master

https://github.com/github/VisualStudio/blob/master/docs/contributing/creating-a-pull-request.md

  1. Open the pull request that you created

https://github.com/github/VisualStudio/blob/master/docs/contributing/reviewing-a-pull-request-in-visual-studio.md

  1. One of the options you have when opening a PR file is View Changes in Solution

https://github.com/github/VisualStudio/blob/master/docs/contributing/reviewing-a-pull-request-in-visual-studio.md#viewing-changes

This will show the differences between your current files and the clean “base” version.

You can leave comments on the static diff which is opened by default (this is what others can see on GitHub). The View Changes in Solution option is intended for developers who are reviewing their own work and might want to make quick changes. There’s a context menu option to Open File in Code View if you want to navigate out of the diff view.

> Any shortcuts available?

The main shortcut for navigating is GitHub.GoToSolutionOrPRFile. This allows navigation between pull request file and your solution (and back). It also allows navigation out of an editable diff file.

> 3) Right clicking on a file in the change list and selecting ‘Open’ opens the temporary, read-only, commit file. Not the ‘current file’. So now I have to open explorer and search for the **bleep** file every @@#$ time. Why would I ever open the read-only commit file anyway when left clicking gives me the diff (with said file)…

I feel your frustration here! In fact, I’ve just submitted a PR that will allow navigation between a read-only commit file and the same file and line in your solution/working directory. It is an extension of the GitHub.GoToSolutionOrPRFile command mentioned above.

There the PR and a link to a build that includes this functionality:

https://github.com/github/VisualStudio/pull/1783

https://ci.appveyor.com/api/buildjobs/sv5p9fdfb9lu4r8j/artifacts/2.5.4.3299%2FGitHub.VisualStudio.vsix

> 4) There are no shortcuts to go to next diff’d file, or a way to ‘check off’ files that I’ve already looked through. It also doesn’t save state, so every time I open up VStudio I have to compare commits again and again…I can’t even save the history window layout/position.

I wish we had this functionality. Reviewing lerge sets of changes is currently hard.

I’d be interested to hear how you get on.

The thing is, I’m reviewing my code not someone elses.

I’ve been working on a large commit for quite a while, now I want to finalize it by (for starters) editing and verifying every changed line.

With about 18,000 lines changed and 100+ files, I can’t: look at a diff, not edit it…search for the related file, then edit that. Verify that I actually changed those lines, look for any others (go back to the diff again). Repeat 100+ times.

versus: Get diff, edit teh current file in-line and have the diff lines update, do a quick glance over and save. Go to next file. That’s at least 10+ minutes faster, not to mention error free!

Note: By edit I mean standerdize some portions of the code.

During the code overhaul I came up with a few ‘neater’ code segments and what not, (funcitonality more or less the same). I want this to be applied everywhere where I had ‘crappier’ versions. Hence, I need to view the diffs, edit those lines to be neater (and make sure they are correct and what not.), and continue.

This is much better than statically comparing pull requests or whatever…

> The thing is, I’m reviewing my code not someone elses.

I tend to submit PRs to myself before reviewing, cleaning up and finally merging. Could you submit a PR to your own fork before subimitting the final PR to upstream? That way you can leave inline comments for things to fix and use the editable diff view for the PR file (i.e View Changes in Solution).

Could you try that and let me know if it goes any smoother?

I’mma try that tomorrow, getting held up on the PR/extension testing by some other projects >.>