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 mergetool: line 291: diff: command not found #163

Closed
calle2010 opened this issue May 28, 2015 · 10 comments · Fixed by git-for-windows/build-extra#61
Closed

git mergetool: line 291: diff: command not found #163

calle2010 opened this issue May 28, 2015 · 10 comments · Fixed by git-for-windows/build-extra#61

Comments

@calle2010
Copy link

Found in: PortableGit-2.4.2.1-release-candidate-64-bit.7z.exe

During execution of git mergetool I got this output:

Normal merge conflict for 'src/main/java
   {local}: created file
   {remote}: created file
/mingw64/libexec/git-core/git-sh-setup: line 291: diff: command not found
fatal: unrecognized input

Indeed there is no diff command on the path.

In msysGit 1.9.5-preview20150319 diff and patch are included.

Thanks!
Christian.

@dscho
Copy link
Member

dscho commented May 28, 2015

Could you please provide a Minimal, Complete & Verifiable Example? This would make it much practicable to verify a fix.

@dscho dscho self-assigned this May 28, 2015
dscho added a commit to git-for-windows/build-extra that referenced this issue May 28, 2015
It is required by `git mergetool`.

This fixes git-for-windows/git#163

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented May 28, 2015

@calle2010 if you cannot quickly come up with an MCVE, please feel free to install the Git SDK and test git-for-windows/build-extra#61 by calling

cd /usr/src/build-extra
git fetch origin refs/pull/61/head
git checkout -b diff FETCH_HEAD
./portable/release.sh 2.4.2.1-calle2010

and then testing the resulting PortableGit installer.

@dscho
Copy link
Member

dscho commented May 28, 2015

@calle2010 please note that after I merged the Pull Request, you have to call

cd /usr/src/build-extra
git fetch origin
git checkout master
./portable release.sh 2.4.2.1-calle2010

instead. Please test.

@calle2010
Copy link
Author

Thank you for the fast reaction. I will replicate the issue and test tomorrow,

@calle2010
Copy link
Author

How to replicate the issue (new repository or file test163 must not exist):

git checkout -b test163 master
echo y > test163
git add test163
git commit -am "test163"
git checkout master
echo z > test163
git add test163
git commit -am "test163 conflict"
git merge test163
git mergetool

This creates a conflict where no 3-way-merge is possible and triggers the error on git mergetool.

Now I will install the SDK to test the fix.

@calle2010
Copy link
Author

The original error message is fixed. But something else happens:

Normal merge conflict for 'test163':
  {local}: created file
  {remote}: created file
<stdin>:5: trailing whitespace.
y
fatal: invalid path './test163_BASE_12928'

I'm not sure where this is coming from. I use p4merge as merge tool. The BASE file is created and seemingly used by p4merge.

@calle2010
Copy link
Author

The latest msysGit also doesn't work perfect in this test case (again with p4merge):

<stdin>:5: trailing whitespace.
y
error: patch failed: ./test163.BASE.23072:1
error: ./test163.BASE.23072: patch does not apply
expr: non-numeric argument

Difference here is that p4merge shows an empty base file.

@calle2010
Copy link
Author

I just tried the same with vimdiff and there is no error message. It must be an issue with my p4merge setup.

The original problem, though, occured also with vimdiff and has been fixed with your change.

Thank you!

@dscho
Copy link
Member

dscho commented May 29, 2015

@calle2010 Thanks for clarifying!

I cannot promise anything, but maybe you want to open a new ticket specifically for the p4 issue? I have no license for Perforce, so I am afraid I can only assist with that issue.

@calle2010
Copy link
Author

I'm analyzing the issue currently. It boils down to a problem in create_virtual_base where git apply doesn't accept paths with ./ anymore since January. But even if I remove the path prefix or use --unsafe-paths the patch generated by diff doesn't apply (similar as in msysGit 1.9.5 above). I will continue investigate and open a new issue with my findings.

jeffhostetler pushed a commit to jeffhostetler/git that referenced this issue Aug 30, 2019
…reamable version

I'm creating this PR for a fourth time (see git-for-windows#163, git-for-windows#171, and git-for-windows#178 for earlier versions). This version is tracking my progress to create something that can be sent as an RFC upstream, but also can be used to start the sparse feature branch. This is based on v2.23.0.

Note: I currently have conflicts with the virtual filesystem feature, and I'll resolve those with a merge commit when I'm ready. I'm just creating this for tracking progress at the moment, but can also be a place for early feedback.

* git sparse-checkout disable to disable the sparse-checkout feature and return to a full checkout.
* git sparse-checkout init --cone, to initialize in cone mode.
* git sparse-checkout add when core.sparseCheckout=cone.

This includes performance improvements with the hashset-based matching algorithm, but I'll leave further enhancements as smaller steps on top. Here are a few things I want to try:

Track the maximum depth of a prefix pattern, so we know to not run hashes for deeper paths.
Use the "known exclude" bit in cone mode to stop hashing paths we know will not be included.
Use the "known include" bit in cone mode to stop hashing paths we know will be included. This is more difficult than "known exclude" because we need to distinguish directories from files when doing path matches so we don't give a directory a "known include" when it isn't a recursive pattern match.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants