yysun / git-tools

This extension provides a git changes tool window, a graphical git history viewer and menus to launch Git Bash, Git Extenstions and TortoiseGit.
http://yysun.github.com/git-tools
MIT License
78 stars 27 forks source link

GitTools for VS2019, Git Changes window not refreshing #27

Open NightOwl888 opened 5 years ago

NightOwl888 commented 5 years ago

Working with GitTools in VS 2017 seems to work fine, but for VS 2019 the "Git Changes" window only seems to work until the first commit. Clicking the "Refresh" button after that point shows the files that were recently checked in, not the active changes in the working directory since the commit.

There doesn't seem to be any remedy for this except to close the solution and reopen it, then it will show the correct changes to the working directory until the next commit, then back to the problem again not showing the changes to the working directory until the solution is closed and reopened.

yysun commented 5 years ago

What is the VS version and what is the Git Tools version are you using?

NightOwl888 commented 5 years ago

Here is my current configuration:

Microsoft Visual Studio Community 2019
Version 16.1.3
VisualStudio.16.Release/16.1.3+29009.5
Microsoft .NET Framework
Version 4.8.03761

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA990
Microsoft Visual C++ 2019

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

ASP.NET and Web Tools 2019   16.1.429.50124
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.1.429.50124
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.1.429.50124
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.3.9000.1
Microsoft Azure Data Lake Tools for Visual Studio

Azure DevOps Status Monitor   1.4
Monitor status of Azure DevOps Service inside Visual Studio

Azure Functions and Web Jobs Tools   16.1.429.50124
Azure Functions and Web Jobs Tools

Azure Logic Apps Tools for Visual Studio   1.0
Add-in for the Azure Resource Group project to support the Logic App Designer and template creation.

Azure Stream Analytics Tools for Visual Studio   2.3.9000.1
Microsoft Azure Stream Analytics Tools for Visual Studio

Bundler & Minifier   2.8.396
Adds support for bundling and minifying JavaScript, CSS and HTML files in any project.

C# Tools   3.1.1-beta4-19281-06+58a4b1e79aea28115e66b06f850c83a3f1fcb6d3
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

ConfigurationTransform   1.3
Automatically transform app.config during build process. Once the transformation is set, it will run on other build machines without the extension.

Cookiecutter   16.1.19129.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

CreateUnitTestBoilerplateCommand Extension   1.0
CreateUnitTestBoilerplateCommand Visual Studio Extension Detailed Info

Extensibility Message Bus   1.1.77 (master@24013d5)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

File Icons   2.7
Adds icons for files that are not recognized by Solution Explorer

Git Tools 2019   3.1.0
This extension provides a git changes window, and menus to launch Git Bash, Git Extenstions and TortoiseGit.

GitExtensions   1.0
Git Extensions is a graphical user interface for Git that allows you to control Git without using the command-line

Image Optimizer   4.0.132
Uses industry standard tools to optimize any JPEG, PNG and Gifs - including animated Gifs. Can do both lossy and lossless optimization.

Microsoft Azure HDInsight Azure Node   2.3.9000.1
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.3.9000.1
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   2.5
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.3.9000.1
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20419.2

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   1.0
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   16.1.1 (2473f22)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.5.10424.1 Commit Hash:c3ce0ae0b29c0b3a755ffc12f8a685fe7ddd3600
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   5.1.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Package Installer   2.0.103
Makes it easier, faster and more convenient than ever to install Bower, npm, Yarn, JSPM, TSD, Typings and NuGet packages to any project

Package Load Explorer   1.0.999
Shows information about how VS packages are loaded in Visual Studio.

PowerShell Pro Tools for Visual Studio   1.0
A set of tools for developing and debugging PowerShell scripts and modules in Visual Studio.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Python   16.1.19129.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Python - Conda support   16.1.19129.1
Conda support for Python projects.

Python - Django support   16.1.19129.1
Provides templates and integration for the Django web framework.

Python - IronPython support   16.1.19129.1
Provides templates and integration for IronPython-based projects.

Python - Profiling support   16.1.19129.1
Profiling support for Python projects.

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61904.23160
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.10506.2004
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.1.1-beta4-19281-06+58a4b1e79aea28115e66b06f850c83a3f1fcb6d3
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.1.0-beta.19253.3+42526fe359672a05fd562dc16a91a43d0fe047a7
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes   1.0
Visual Studio Tools for Kubernetes

Visual Studio Tools for Unity   4.1.1.0
Visual Studio Tools for Unity

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.1.0.543 (d16-1@34a619991)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   16.1.0.418 (remotes/origin/d16-1@5b958bb10)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   16.2.112 (4db4af4)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   9.3.0.22 (HEAD/8e7764fdf)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: mono/mono/2018-08@3cb36842fc4
    Java.Interop: xamarin/java.interop/d16-1@5ddc3e3
    LibZipSharp: grendello/LibZipSharp/d16-1@44de300
    LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
    ProGuard: xamarin/proguard/master@905836d
    SQLite: xamarin/sqlite/3.27.1@8212a2d
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-1@acabd26

Xamarin.iOS and Xamarin.Mac SDK   12.10.0.153 (750a879)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

I was using GitTools 2.0.8 when I first noticed the behavior, but I have just upgraded to 2.1.0. This version seems even worse. Now clicking the refresh button has no effect at all, so I am not seeing anything in the Git Changes list even when there are changes in the working directory.

Closing and reopening the solution still seems to fix it temporarily. Undoing the edits to the file makes the diff view clear up, but the file still shows in the list as Modified until I close and reopen the solution again.

yysun commented 5 years ago

You can try to close/minimized the Git Changes Window and open it again instead of closing/opening the solution.

You can also check the file: %USERPROFILE%/Documents/gitscc.config to see if it has DisableAutoRefresh being true.

NightOwl888 commented 5 years ago

It doesn't look like I have a gitscc.config file.

Closing and reopening the Git Changes window is a better workaround than closing and reopening the solution. But, it would still be nice if the refresh button worked or even better still if the auto-refresh worked.

yysun commented 5 years ago

Undoing the edits to the file makes the diff view clear up, but the file still shows in the list as Modified until I close and reopen the solution again.

I find out a scenario that might be related to this: there are white spaces changes in the file.

I will make 3.1.1 to show white space as it is in v2017.

image

And will add a checkbox to toggle the white space in the diff view later on.

yysun commented 5 years ago

Auto refresh is also changed in v2019. It refreshes all the times in v2017. It only refreshes only when the Git Changes window is opened. The refresh button is designed to force refresh no matter how.

I am trying to reproduce the scenario when the auto-refresh not starting.

NightOwl888 commented 5 years ago

Thanks.

I have upgraded to 3.1.1. I am still seeing the behavior when I do a commit, then click refresh, that it incorrectly shows the files that were just committed, not the dirty files in the working directory.

To be clear, the commit clears out the contents of Git Changes, but refresh re-displays the contents of the commit rather than displaying any changes that were made since the commit. The following three screenshots were all taken with the repository and working directory in the same state (and refresh has been clicked).

image

image

image

AndrewH2O commented 5 years ago

I too have the same issue with VS 2019 and gittools 3.1.1

This was fixed by checking the config file gitscc.config as suggested where DisableAutoRefresh was set to true. Changes are now picked up. Thank you.

However there is still an issue with the manual refresh (when auto refresh is disabled) as latest changes are not picked up. This seems to be when changes are first made to a file. Also making a change and then reversing it still shows that a commit is required even if the diff view is empty (probably a symptom of the first). Closing and reopening the Git changes window resolves this. Solution Explorer is doing change tracking OK.

Below are my config settings before I changed AutoRefresh

<?xml version="1.0" encoding="utf-8"?>
<GitSccOptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <GitBashPath>C:\Program Files\Git\bin\git.exe</GitBashPath>
  <GitExtensionPath>c:\Program Files (x86)\GitExtensions\GitExtensions.exe</GitExtensionPath>
  <DifftoolPath>c:\Program Files (x86)\KDiff3\kdiff3.exe</DifftoolPath>
  <NotExpandTortoiseGit>false</NotExpandTortoiseGit>
  <NotExpandGitExtensions>false</NotExpandGitExtensions>
  <UseTGitIconSet>false</UseTGitIconSet>
  <DisableAutoRefresh>true</DisableAutoRefresh>
  <DisableAutoLoad>false</DisableAutoLoad>
  <NotUseUTF8FileNames>false</NotUseUTF8FileNames>
  <UseVsDiff>true</UseVsDiff>
</GitSccOptions>
AndrewH2O commented 5 years ago

An easy way to reproduce the problem (with <DisableAutoRefresh>true</DisableAutoRefresh>) New project e.g .net core console app In solution explorer click on the solution right click and from the menu add it to source control. (I have git selected in my VS Settings).

Solution explorer shows icons next to files and viewing explorer confirms local .git repo created Using Git extensions the initial project files are indeed in the repository.

Make any change to program.cs and refresh git changes doesn't track the changes. Closing and re-opening Git changes window makes no difference.

Once visual studio is re-opened the program.cs is showing as modified and can be staged/commited.

Hope this helps.

yysun commented 5 years ago

Thanks for sending the repro steps. I will debug it.

On Sat, Sep 7, 2019 at 9:41 AM Andrew Waters notifications@github.com wrote:

An easy way to reproduce the problem (with true) New project e.g .net core console app In solution explorer click on the solution right click add it to source control (I have git selected in my VS Settings).

Solution explorer shows icons next to files and viewing explorer confirms local .git repo created Using Git extensions the initial project files are indeed in the repository.

Make any change to program.cs and refresh git changes doesn't track the changes. Closing and re-opening Git changes window makes no difference.

Once visual studio is re-opened the program.cs is showing as modified and can be staged/commited.

Hope this helps.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/yysun/git-tools/issues/27?email_source=notifications&email_token=AABJUM66UIIFSCMECBE3CVDQIOVSNA5CNFSM4HZQTPV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6EZDGI#issuecomment-529109401, or mute the thread https://github.com/notifications/unsubscribe-auth/AABJUM3KYJJM4KSSNPNUU6TQIOVSNANCNFSM4HZQTPVQ .

jcspader commented 4 years ago

+1

BrandesEric commented 4 years ago

I am having this issue too.

FallenDev commented 3 years ago

Issue persists. Visual Studio Enterprise 2019 Preview Version 16.11.0 Preview 3.0 Did a refactor where I renamed 39 files from MapId => ID, only shows 14 files have changes. I've restarted my solution and have unloaded and reloaded the project. I have also traversed to that documents location and have not found a git.config file to edit.

roman-yagodin commented 3 years ago

Same issue here: Microsoft Visual Studio Professional 2019 Version 16.11.2

Note that standard "Git Changes" window in VS demonstrate same behaviour.

aschuhardt commented 2 years ago

FYI this is also present in 16.11.1 Preview 1.0

geekySunny commented 2 years ago

Cannot see Git in menu options or Git changes either. Even after installing git extension

Martin-Maat commented 2 years ago

Apparently this is still/again an issue in Visual Studip 2022 Preview 2.0. I am using Git Server on a Synology NAS, perhaps this has something to do with it.