git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.35k stars 2.53k forks source link

git difftool puts extra / in the file path, causing it to be invalid #1047

Closed burkematthew closed 7 years ago

burkematthew commented 7 years ago

Setup

git version 2.10.2.windows.1 sizeof-long: 4 x86

Windows 7 x86

Path Option: Cmd SSH Option: OpenSSH CRLF Option: CRLFAlways Bash Terminal Option: ConHost Performance Tweaks FSCache: Enabled Use Credential Manager: Enabled Enable Symlinks: Disabled Enable Builtin Difftool: Disabled

Details

PowerShell

I ran git difftool with uc.exe set up in my config file:

image

image

I expected the remote file to compare to the local version of the file.

image

The file path was invalid due to an extra //.

The file does exist in the location indicated:

image

dscho commented 7 years ago

Enable Builtin Difftool: Disabled

Could you try with the builtin difftool enabled? (You should be able to do that temporarily by calling git -c difftool.usebuiltin=true difftool ...)

burkematthew commented 7 years ago

Ran the following command:

[cid:image001.png@01D28B90.181BC3F0]

Same results:

[cid:image002.png@01D28B90.181BC3F0]

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Monday, February 20, 2017 3:38 PM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

Enable Builtin Difftool: Disabled

Could you try with the builtin difftool enabled? (You should be able to do that temporarily by calling git -c difftool.usebuiltin=true difftool ...)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-281187216, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoAzqC5ffao-hkpaLPfl80ZoDyoLPQks5regfPgaJpZM4L1O5Q.

dscho commented 7 years ago

On Mon, 20 Feb 2017, burkematthew wrote:

Ran the following command:

[cid:image001.png@01D28B90.181BC3F0]

I will try to remember to look at this when I have a chance to see those images (I am reading this in a text-only window right now... hint for the future: not always does a picture say more than some well-crafted, concise text...)

burkematthew commented 7 years ago

I normally like to supply pictures as “proof” that I am running what I am saying I am. I am used to dealing with clients who rarely do what they are saying they are doing, and I am sure that you may run into the same situation. As a result, I tend to send screenshots. But, for your purposes, I will just supply the text:

I typed the following command:

git –c difftool.usebuiltin=true difftool

I then received the following error message:

C:\Users\mburke\AppData\Local\Temp\MxMG4c_brudd.cbl is not a valid path.

Notice the extra backslash after Temp and before the file name. This Temp file DOES actually exist at the location and when you remove the second slash from the file path, you are able to run UltraCompare and see the differences between the remote and the local.

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Tuesday, February 21, 2017 7:56 AM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

On Mon, 20 Feb 2017, burkematthew wrote:

Ran the following command:

[cid:image001.png@01D28B90.181BC3F0]

I will try to remember to look at this when I have a chance to see those images (I am reading this in a text-only window right now... hint for the future: not always does a picture say more than some well-crafted, concise text...)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-281350614, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA4dwfM1zwBj6REk3FLw68PdBtPTGks5reu0BgaJpZM4L1O5Q.

dscho commented 7 years ago

Ran the following command: [cid:image001.png@01D28B90.181BC3F0] Same results: [cid:image002.png@01D28B90.181BC3F0]

BTW this is really all that arrived at GitHub. No images. Just this [cid:...] text.

Also: I tried to reproduce the issue here, failing so far. This is the command I called in Git Bash:

GIT_TRACE=1 git -c difftool.usebuiltin=true difftool --tool=vimdiff

And the relevant part of the output reads:

23:51:07.486389 run-command.c:369       trace: run_command: 'git-difftool--helper' 'mingw-w64-git/PKGBUILD' 'C:/Users/johasc/AppData/Local/Temp/PVwqkc_PKGBUILD'
 '357d46de8f19a8334f3f09d2e70a4979623f838e' '100644' 'mingw-w64-git/PKGBUILD' '0000000000000000000000000000000000000000' '100644'

As you can see, there are no double slashes here...

dscho commented 7 years ago

FWIW I repeated the same command in Powershell and it also worked, i.e. it did not use any double slash in any path.

burkematthew commented 7 years ago

I just noticed that my PowerShell is out of date. I will update that and let you know if the results still occur. I apologize if this is the problem. I know how annoying and frustrating it can be when it is something like that that people waste your time with. But, I will let you know what I find.

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Tuesday, February 21, 2017 5:04 PM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

FWIW I repeated the same command in Powershell and it also worked, i.e. it did not use any double slash in any path.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-281511553, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA_oZUFm1yI_nhUx_XNluw8ObCO3gks5re21tgaJpZM4L1O5Q.

burkematthew commented 7 years ago

After updating PowerShell, I still have the same results, so it wasn’t a PowerShell issue.

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Tuesday, February 21, 2017 5:04 PM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

FWIW I repeated the same command in Powershell and it also worked, i.e. it did not use any double slash in any path.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-281511553, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA_oZUFm1yI_nhUx_XNluw8ObCO3gks5re21tgaJpZM4L1O5Q.

dscho commented 7 years ago

Well, I still cannot reproduce. Maybe you can call difftool after setting GIT_TRACE=1 and maybe that output sheds some light into your issue? (It could be something as benign as a trailing slash in your $env:TEMP.)

burkematthew commented 7 years ago

Now I am having an issue where I cannot use git trace. Running,

git_trace=1 git difftool

I receive a message stating that the term git_trace=1 is not recognized as the name of a cmdlet, function, script file, or operaple program.

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Tuesday, February 21, 2017 5:36 PM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

Well, I still cannot reproduce. Maybe you can call difftool after setting GIT_TRACE=1 and maybe that output sheds some light into your issue? (It could be something as benign as a trailing slash in your $env:TEMP.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-281517983, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA44vy9p45-_RBhmWyzwO7gbmHP8Aks5re3TFgaJpZM4L1O5Q.

fourpastmidnight commented 7 years ago

GIT_TRACE must be in all caps as shown. You're temporarily setting an environment variable for the command that follows.

burkematthew commented 7 years ago

I receive the same error with the following command:

GIT_TRACE=1 git difftool

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Craig E. Shea [mailto:notifications@github.com] Sent: Wednesday, February 22, 2017 7:54 AM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

GIT_TRACE must be in all caps as shown. You're temporarily setting an environment variable for the command that follows.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-281675153, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA5Nn4KyzSCuDhQE8Wuwc_qQzkX3uks5rfD4LgaJpZM4L1O5Q.

dscho commented 7 years ago

I receive the same error with the following command: GIT_TRACE=1 git difftool

Is there any chance you can provide more context or try a little more?

From your report, it looks as if you are using Powershell, but the GIT_TRACE=1 git difftool command-line is clearly intended for Bash. in Powershell, it would look more like this: $env:GIT_TRACE="1"; git difftool

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<#1047 (comment)>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA44vy9p45-_RBhmWyzwO7gbmHP8Aks5re3TFgaJpZM4L1O5Q.

Are you really sure that you want to include the information how to mute this thread on your side? :smile:

burkematthew commented 7 years ago

Condescension does not help solve the problem. I have spent hours troubleshooting this problem using all of the context possible and I did so before ever reaching out.

The context surrounding my message about GIT_TRACE=1 git difftool was surrounding the previous message strings that were involved in this thread about receiving an error with the tracing functionality.

I was able to successfully run the GIT_TRACE function and it did not specifically give me more information. However, i looked into the Temp Environment Variable.

When running the following command:

$env:TEMP

I receive the output C:\Users\Mburke\AppData\Local\Temp\, which would explain the trailing slash. Is this my local PC’s environment variable or is it an environment variable specific to the PowerShell?

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Thursday, February 23, 2017 11:01 AM To: git-for-windows/git Cc: Matthew Burke; Author Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

I receive the same error with the following command: GIT_TRACE=1 git difftool

Is there any chance you can provide more context or try a little more?

From your report, it looks as if you are using Powershell, but the GIT_TRACE=1 git difftool command-line is clearly intended for Bash. in Powershell, it would look more like this: $env:GIT_TRACE="1"; git difftool

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<#1047https://github.com/git-for-windows/git/issues/1047 (comment)>, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA44vy9p45-_RBhmWyzwO7gbmHP8Aks5re3TFgaJpZM4L1O5Q.

Are you really sure that you want to include the information how to mute this thread on your side? 😄

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-282053328, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA6CTGp5yHjuB-JaIIbozFc9b35Z4ks5rfbs5gaJpZM4L1O5Q.

fourpastmidnight commented 7 years ago

@burkematthew On my Win 10 machine, my user TEMP variable does not have the training \. Perhaps, then, removing the trailing \ will resolve your issue.

burkematthew commented 7 years ago

I found that it is actually the TMP Environment Variable in the PowerShell that is causing the underlying problem. I have a solution to this issue now. Thank you to everyone for their input in the attempt to find the solution.

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Craig E. Shea [mailto:notifications@github.com] Sent: Thursday, February 23, 2017 4:54 PM To: git-for-windows/git Cc: Matthew Burke; Mention Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

@burkematthewhttps://github.com/burkematthew On my Win 10 machine, my user TEMP variable does not have the training . Perhaps, then, removing the trailing \ will resolve your issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-282148403, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA1zgNHQYPzzSMVh1H2U-C0KDjkLpks5rfg37gaJpZM4L1O5Q.

dscho commented 7 years ago

I found that it is actually the TMP Environment Variable in the PowerShell that is causing the underlying problem.

That cannot be the complete story. The default for both TEMP and TMP is %USERPROFILE%\AppData\Local\Temp in the User variables (and C:\WINDOWS\TEMP in the System variables) when you click the Environment Variables... button in the Advanced tab of the System Properties.

I have a solution to this issue now.

In the future, please do feel free to share such a solution with the people who spent time trying to help you, and also feel more than welcome to indicate that your problem is solved by closing the ticket.

burkematthew commented 7 years ago

Yes, in fact, it is the complete story. My User variables for my PC’s environment variables of TEMP and TMP did not have trailing slashes, but my Environment Variables in my PowerShell did. I first changed the TEMP Environment Variable and ran the git difftool command to find the issue still occurring. However, upon removing the trailing slash from the TMP Environment Variable, git difftool pulled up in my UltraCompare window without the double slashes in the path, which meant that my difference comparison was now a valid comparison between my remote and local files.

Also, I don’t know how I could have shared more of a solution than “it is actually in the TMP Environment Variable in the PowerShell that is causing the underlying problem”.

And yes, I will close tickets when they are resolved in the future. I was unaware that I could be one to close tickets as everyone does support ticketing in different ways.

Thank you to everyone for their assistance.

Thank you,

Matthew Burke | Chief Information Officer | Hubbard Systems 130 Inverness Plaza Box #110 | Birmingham, Alabama 35242 O 800.933.7995 | D 205.263.1507 | F 205.871.3155 www.hubbardsystems.comhttp://www.hubbardsystems.com/

[btn_twitter]https://twitter.com/HubbardSystems [btn_linkedin] http://www.linkedin.com/company/hubbard-systems-inc. THE SOFTWARE. THE SUPPORT. THE SOLUTION.

From: Johannes Schindelin [mailto:notifications@github.com] Sent: Friday, February 24, 2017 7:12 AM To: git-for-windows/git Cc: Matthew Burke; Mention Subject: Re: [git-for-windows/git] git difftool puts extra / in the file path, causing it to be invalid (#1047)

I found that it is actually the TMP Environment Variable in the PowerShell that is causing the underlying problem.

That cannot be the complete story. The default for both TEMP and TMP is %USERPROFILE%\AppData\Local\Temp in the User variables (and C:\WINDOWS\TEMP in the System variables) when you click the Environment Variables... button in the Advanced tab of the System Properties.

I have a solution to this issue now.

In the future, please do feel free to share such a solution with the people who spent time trying to help you, and also feel more than welcome to indicate that your problem is solved by closing the ticket.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/git-for-windows/git/issues/1047#issuecomment-282287660, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVdoA-3bEilyO5bEU2rjBCT4veQ5gcnVks5rftcdgaJpZM4L1O5Q.

dscho commented 7 years ago

My User variables for my PC’s environment variables of TEMP and TMP did not have trailing slashes, but my Environment Variables in my PowerShell did.

I just looked, and echo $env:TEMP as well as echo $env:TMP in my Powershell both list the path without trailing slash. Maybe something in your Powershell PROFILE (echo $PROFILE will show you the path of that file) has something that adds that slash?

For the record: I have posh-git installed, and that component does modify the Powershell PROFILE. However, I got the same result in a VM where I do not have that component installed, i.e. I have a pristine Powershell PROFILE there.