Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git difftool suddenly dies in 2.20 #1974

Closed
MarkKharitonov opened this issue Dec 10, 2018 · 18 comments
Closed

git difftool suddenly dies in 2.20 #1974

MarkKharitonov opened this issue Dec 10, 2018 · 18 comments
Milestone

Comments

@MarkKharitonov
Copy link

MarkKharitonov commented Dec 10, 2018

I have already downgraded to 2.18, but I am pretty certain the regression comes from 2.20:

C:\DFDeploymentSmokeTests [master ↑3 +0 ~12 -0 !]> git difftool
error: cannot spawn Í?: No such file or directory
fatal: external diff died, stopping at NonUITests/SiteCheck.cs

Everything works once I downgraded to 2.18.

@dscho
Copy link
Member

dscho commented Dec 10, 2018

And I am pretty certain that this bug report is incomplete:

$ git difftool                                                                                                                                                    This message is displayed because 'diff.tool' is not configured.
See 'git difftool --tool-help' or 'git help config' for more details.
'git difftool' will now attempt to use one of the following tools:
opendiff kdiff3 tkdiff xxdiff meld kompare gvimdiff diffuse diffmerge ecmerge p4 merge araxis bc codecompare emerge vimdiff
Viewing (1/1): 'README.md'
Launch 'vimdiff' [Y/n]?

When I say y, it works.

This is with a 64-bit Git for Windows installed via the official installer, using Secure Channel and the "check daily for updates" checked, otherwise default options.

@dakotahawkins
Copy link

@dscho In case this is the same thing or same class of things, I upgraded this morning and has find kill my console. Will report back or file another issue if it happens again or I get new info.

@dscho
Copy link
Member

dscho commented Dec 10, 2018

@dakotahawkins that sounds worrisome. Hopefully you can gather more information on this.

@gunnar22
Copy link

gunnar22 commented Dec 14, 2018

I observed the same problem (as reported by MarkKharitonov) in git v2.20 on Windows. (I have not tried other versions after v2.20, I can not say for sure when the regression started).

I did a little bit of research. Try to do like this:
Keep watching the Temp folder where the temporary files are placed before diff starts (repeated for each pair of files in a loop), which is C:/Users/<username>/AppData/Local/Temp
Start diffing between two commits where there are several altered files.
git difftool <commit1> <commit2>
Not necessary to use the -y option. (You may, but it is easier to analyse if you don't).
And answer n to all the Launch 'toolname' [Y/n]? n
so that it does not actually try to do any real diffing of the files.
In my system it loops from file to file and runs fine for the approximately first 5 to 8 file pairs.
Watching the Temp folder, I can see that it places temporary files with decorated names (e.g., q97v0a_MySource.h) there to be diffed.
Then suddenly the error occurs:

When the error occurs, it has NOT placed the temporary files to be diff'ed into the Temp folder.

So, it is not the diffing that is the problem. It seems to be more related to what the error message says: "No such file..."

@dscho
Copy link
Member

dscho commented Dec 17, 2018

When the error occurs, it has NOT placed the temporary files to be diff'ed into the Temp folder.

Is it always the same file?

@gunnar22
Copy link

Each experiment is repeatable, but if I change the experiment (i.e., specify other commits) it may have a different number of successes and fail on a different file than in the previous experiment.

@vdurante
Copy link

I have the same issue here. The issue feels random but it feels like it has more chances of happening on some files.

@morgaalb
Copy link

morgaalb commented Dec 18, 2018

I also have this issue. It seems to occur when using git difftool on a repo with more than 23 submodules. It only seems to happen when running git difftool and not git difftool <path>.

@dscho
Copy link
Member

dscho commented Dec 18, 2018

It seems to occur when using git difftool on a repo with more than 23 submodules.

Can you verify that by making a really small repository from scratch, with 23 fake submodules?

@gunnar22
Copy link

I guess that submodules is not the reason. My case also has submodules, but a lot fewer than quoted.

@morgaalb
Copy link

Thanks for the reply, @dscho. Here's the (quick and dirty) script I used to reproduce the problem (assumes that you have already created the submodule repo that gets added):

#!/bin/bash

mkdir original$1
cd original$1
git init
touch foo
git add foo
git commit --no-verify -m "Foo"
for i in $( eval echo {1..$1} );
do
    git submodule add /d/foo/git_bug_test/sub sub$i
done
echo "Hello world" > foo
git difftool

When running the script with '23' as an argument, difftool works fine. When using '24' or more, I get the following output (many many lines of submodule creation removed)

...
error: cannot spawn D:/foo/git_bug_test/original24/.git/objects/: No such file or directory
fatal: external diff died, stopping at foo

Oh, this is under Windows 10, and I've reproduced it using 2.20.0 and 2.20.1 on different machines.

@morgaalb
Copy link

Additional note: when running difftool on different repos, sometimes it says it cannot spawn "Í?" or some other garbage characters, sometimes it says it cannot spawn some path in the ".git" folder (like in my example) and sometimes it seems to make up some nonexistent path in the ".git" folder, although I haven't been able to reproduce the different ways it seems to fail with a test repo.

@gunnar22
Copy link

gunnar22 commented Dec 18, 2018

I have reproduced the issue in another repository. I forked and cloned to my PC the open source project https://github.com/osmandapp/Osmand
Then on my PC
git difftool master~50 master
Viewing (1/25): 'OsmAnd-java/src/net/osmand/data/Postcode.java
Launch 'p4merge' [Y/n]? n
and so on successfully until
Viewing (7/25): 'OsmAnd/src/net/osmand/plus/OsmandApplication.java'
Launch 'p4merge' [Y/n]? n
error: cannot spawn Q?: No such file or directory
fatal: external diff died, stopping at OsmAnd/src/net/osmand/plus/OsmandSettings.java

The master~50 master was arbitrarily chosen, master~30 master~10 gave same effect and number of successes before fail. (master was at d7ba8b39d0).

I have installed git from git-scm.com download: Git-2.20.1-64-bit.exe. Windows 7, Git Bash.

@gunnar22
Copy link

I downloaded and tested a series of versions, and here are the results:

Version Result
2.18.0.windows.1 OK
2.19.0.rc0.windows.1 OK
2.19.0.rc0.windows.2 OK
2.19.0.rc1.windows.1 OK
2.19.0.rc2.windows.1 OK
2.19.0.windows.1 OK
2.19.1.windows.1 OK
2.19.2.windows.1 BUG
2.20.0.rc0.windows.1 BUG
2.20.0.rc1.windows.1 BUG
2.20.0.rc2.windows.1 BUG
2.20.0.windows.1 BUG
2.20.1.windows.1 BUG

@dscho
Copy link
Member

dscho commented Jan 11, 2019

@PhilipOakley yep, I think you are spot on, this is likely the same bug as #2007.

@dscho
Copy link
Member

dscho commented Jan 18, 2019

Can y'all try the latest snapshot at https://wingit.blob.core.windows.net/files/index.html? It should be fixed there.

@gunnar22
Copy link

git version 2.20.1.windows.1.25.g9e107c96c0 works for me. Problem is fixed. Thanks kgybels and dscho!

@dscho dscho added this to the v2.20.1(2) milestone Jan 23, 2019
@dscho
Copy link
Member

dscho commented Jan 23, 2019

@gunnar22 thanks for testing and confirming the fix!

@dscho dscho closed this as completed Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants