gitextensions / gitextensions

Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2015/2017/2019).
https://gitextensions.github.io/
Other
7.7k stars 2.08k forks source link

'reset changes' Exception Thrown #593

Closed markpizz closed 12 years ago

markpizz commented 13 years ago

I unpacked a .zip file to a folder.

Somewhere down in the directory tree provided in this zip file was a git repository (I didn't initially realize this), but wanted to track my changes to the contents of the zip file, In order to do this, I created a new repository at the top of the directory tree where I unpacked the zip file. I then committed the 'changes' which were the whole zip file import. During the commit, I selected all of the files listed in the 'working dir changes' and staged them all and went forward with the commit. The commit suceeded but produced a message which said it was ignoring a specific directory somewhere down in the tree. I looked at this directory and noticed the reason for the 'ignore' was due to the fact that that directory was another repository. This made sense.

So I made a few changes and realized that I didn't like where I was and wanted to revert to where I started.

I opened the commit dialog, and selected all of the files in the 'working dir changes' subwindow. I right clicked on this and selected 'reset file changes'. The result was that an error dialog poped (details below), I could select all of the file sin the 'working dir changes' except the folder containing the imbedded git repo and was able to successfully reset the changes on all of these files. This left the nested repo listed in the working dir changes subwindow. Attempting to reset file changes again producess the same error.

I'm not sure what the 'best' behavior here should be, but a thrown exception is probably not the right answer.....

Thanks.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

\ Exception Text ** System.UnauthorizedAccessException: Access to the path 'H:\Local\Projects\winpcap_4_1_2\winpcap\wpcap\libpcap\' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.Delete(String path) at GitUI.FormCommit.ResetSoftClick(Object sender, EventArgs e) at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e) at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e) at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e) at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ToolStrip.WndProc(Message& m) at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

\ Loaded Assemblies ** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

GitExtensions Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/GitExtensions.exe

GitUI Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/GitUI.DLL

System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

GitCommands Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/GitCommands.DLL

GitUIPluginInterfaces Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/GitUIPluginInterfaces.DLL

ResourceManager Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/ResourceManager.DLL

System.Core Assembly Version: 3.5.0.0 Win32 Version: 3.5.30729.5420 built by: Win7SP1

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll

System.Deployment Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll

System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

AutoCheckForUpdates Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/AutoCheckForUpdates.dll

AutoCompileSubmodules Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/AutoCompileSubmodules.dll

CreateLocalBranches Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/CreateLocalBranches.dll

DeleteUnusedBranches Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/DeleteUnusedBranches.dll

Github Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/Github.dll

GithubSharp.Core Assembly Version: 1.0.4086.34883 Win32 Version: 1.0.4086.34883

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/GithubSharp.Core.DLL

System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

GitImpact Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/GitImpact.dll

GitStatistics Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/GitStatistics.dll

Gource Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Plugins/Gource.dll

bienxd_s Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

ICSharpCode.TextEditor Assembly Version: 4.0.0.3889 Win32 Version: 4.0.0.3889

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/ICSharpCode.TextEditor.DLL

emvf-wio Assembly Version: 2.24.0.0 Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

j0rmyug4 Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

uhg8yukk Assembly Version: 2.24.0.0 Win32 Version: 2.0.50727.5447 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

Microsoft.WindowsAPICodePack.Shell Assembly Version: 1.1.0.0 Win32 Version: 1.1.0.0

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Microsoft.WindowsAPICodePack.Shell.DLL

Microsoft.WindowsAPICodePack Assembly Version: 1.1.0.0 Win32 Version: 1.1.0.0

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Microsoft.WindowsAPICodePack.DLL

PresentationFramework Assembly Version: 3.0.0.0 Win32 Version: 3.0.6920.5011 built by: Win7SP1

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll

WindowsBase Assembly Version: 3.0.0.0 Win32 Version: 3.0.6920.5011 built by: Win7SP1

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll

PresentationCore Assembly Version: 3.0.0.0 Win32 Version: 3.0.6920.5011 built by: Win7SP1

CodeBase: file:///C:/Windows/assembly/GAC_64/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll

Gravatar Assembly Version: 2.24.0.0 Win32 Version: 2.24

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/Gravatar.DLL

NetSpell.SpellChecker Assembly Version: 2.1.7.35462 Win32 Version: 2.1.7.35462

CodeBase: file:///C:/Program%20Files%20(x86)/GitExtensions/NetSpell.SpellChecker.DLL

\ JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

vcpp commented 13 years ago
  1. Of course, exception is a bug. We should handle this and display more friendly dialog, but it still will be an error dialog.
  2. Do you have TortoiseGit installed? It's "TGitCache.exe" process can keep opened file handlers inside git repositories (it seems like a resources leak). Simple solution is to disable an overlay icons (or try to update to 1.7.3, issue may be fixed)
  3. Can you delete newly created files manually with Windows Explorer or another file manager? If not, try some tool to blame program which locks those files (i.e. Process Explorer or LockHunter).
  4. Check file attributes (readonly) and your filesystem permissions.
markpizz commented 13 years ago

1) An error dialog would be OK if there really is an error. 2) I DO NOT have TortoiseGit installed. 3) Yes I can delete the directory in the tree which GitExtensions has isues with. This is the exact sma directory which was 'ignored' during the initial import of everything into the new repository (due to it already containing a .git sub directory). The content of this subdirectory are not in the current repository (due to the above mentioned ignore). 4) There are no permission issues causing this. I was able to simply remove the whole directory with a rmdir/s