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 2.29.2 difftool no longer working #2893

Closed
bit-bash opened this issue Nov 6, 2020 · 8 comments · Fixed by #2899
Closed

Git 2.29.2 difftool no longer working #2893

bit-bash opened this issue Nov 6, 2020 · 8 comments · Fixed by #2899
Milestone

Comments

@bit-bash
Copy link

bit-bash commented Nov 6, 2020

  • [X ] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.29.2.windows.2
cpu: x86_64
built from commit: 3464b98ce6803c98bf8fb34390cd150d66e4a0d3
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18363.657]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
$ cat /etc/install-options.txt

Editor Option: Nano
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Disabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I am trying to invoke BeyondCompare with git difftool -d HEAD~1
Section in ~/.gitconfig is:

[diff]
        tool = bc4
[difftool "bc4"]
        cmd = \"c:/program files/beyond compare 4/bcompare.exe\" \"$LOCAL\" \"$REMOTE\"

Note, this WORKS when I downgrade to git 2.28.0, and there are no other changes.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Bash

git difftool -d HEAD~1
  • What did you expect to occur after running these commands?

I expected BeyondCompare to launch, showing the differences between working dir and previous commit.

  • What actually happened instead?

There is a slight delay, then nothing happens and I'm back to the shell prompt.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Tried many different repo, I can reproduce on any of them.

I have reproduced this issue on two different Windows 10 systems.
Current workaround is to use git 2.28.0.

@dscho
Copy link
Member

dscho commented Nov 6, 2020

Have you looked whether the log produced with GIT_TRACE contains anything interesting?

@bit-bash
Copy link
Author

bit-bash commented Nov 7, 2020

Have you looked whether the log produced with GIT_TRACE contains anything interesting?

I've installed 2.28.0, but when I get a chance, I'll re-install 2.29.2 and run again with GIT_TRACE.

@dscho
Copy link
Member

dscho commented Nov 10, 2020

I've installed 2.28.0, but when I get a chance, I'll re-install 2.29.2

FWIW if you want to keep your v2.28.0 but just want to run the test I asked for with v2.29.2, you can install a Portable Git (which will not overwrite your existing installation).

@bit-bash
Copy link
Author

bit-bash commented Nov 10, 2020

Good suggestion! Results are inconclusive - I can't see any smoking gun in the trace logs.

Installed 2.28.0 works with: git difftool -d HEAD~1
Portable (or previously installed 2.29.2) does not work with: git difftool -d HEAD~1

trace2.28.0.txt
trace2.29.2.txt

@dscho
Copy link
Member

dscho commented Nov 11, 2020

Okay, I think I know what is going on: 83bbf9b, contributes via https://lore.kernel.org/git/[email protected]/, broke it. Basically, it overrides the user setup because bc4 and bc sound so similar. My current working hypothesis is that this fixes it:

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index 2defef28cd93..7225abd81122 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -138,6 +138,10 @@ setup_user_tool () {
 	merge_cmd () {
 		( eval $merge_tool_cmd )
 	}
+
+	list_tool_variants () {
+		echo "$tool"
+	}
 }
 
 setup_tool () {

If you get a chance, would you mind making that change manually (by editing /mingw64/libexec/git-core/git-mergetool--lib, you might need administrator privileges, adding the list_tool_variants () definition at the end of the setup_user_tool () function)?

I will try to get this patch into a mergeable and submittable form in the meantime.

dscho added a commit to dscho/git that referenced this issue Nov 11, 2020
As of 83bbf9b (mergetool--lib: improve support for vimdiff-style
tool variants, 2020-07-29), we already list `bc` and `bc3` as aliases
for that mergetool/difftool.

However, the current Beyond Compare version is _4_, therefore the `bc4`
alias is missing from that list.

Most notably, this is the root cause of the breakage reported in
git-for-windows#2893 where a
well-configured `bc4` difftool stopped working as of v2.29.0:
`setup_tool` would notice that after stripping off the trailing digit,
it finds a match in `mergetools/` (the `bc` file), source it, and then
the alias would not match the list offered by the `list_tool_variants`
function, and simply exit without doing anything, but pretending
success.

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Nov 11, 2020
As of 83bbf9b (mergetool--lib: improve support for vimdiff-style
tool variants, 2020-07-29), we already list `bc` and `bc3` as aliases
for that mergetool/difftool.

However, the current Beyond Compare version is _4_, therefore the `bc4`
alias is missing from that list.

Most notably, this is the root cause of the breakage reported in
git-for-windows#2893 where a
well-configured `bc4` difftool stopped working as of v2.29.0:
`setup_tool` would notice that after stripping off the trailing digit,
it finds a match in `mergetools/` (the `bc` file), source it, and then
the alias would not match the list offered by the `list_tool_variants`
function, and simply exit without doing anything, but pretending
success.

Signed-off-by: Johannes Schindelin <[email protected]>
@bit-bash
Copy link
Author

bit-bash commented Nov 11, 2020

If you get a chance, would you mind making that change manually (by editing /mingw64/libexec/git-core/git-mergetool--lib, you might need administrator privileges, adding the list_tool_variants () definition at the end of the setup_user_tool () function)?

I made the edit (using portable git) and I can confirm this fixes the issue! Yay!

@dscho
Copy link
Member

dscho commented Nov 11, 2020

Good, thanks for testing!

gitster pushed a commit to git/git that referenced this issue Nov 11, 2020
As of 83bbf9b (mergetool--lib: improve support for vimdiff-style
tool variants, 2020-07-29), we already list `bc` and `bc3` as aliases
for that mergetool/difftool.

However, the current Beyond Compare version is _4_, therefore the `bc4`
alias is missing from that list.

Most notably, this is the root cause of the breakage reported in
git-for-windows#2893 where a
well-configured `bc4` difftool stopped working as of v2.29.0:
`setup_tool` would notice that after stripping off the trailing digit,
it finds a match in `mergetools/` (the `bc` file), source it, and then
the alias would not match the list offered by the `list_tool_variants`
function, and simply exit without doing anything, but pretending
success.

Signed-off-by: Johannes Schindelin <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
@dscho dscho added this to the Next release milestone Nov 12, 2020
@dscho
Copy link
Member

dscho commented Nov 12, 2020

@bit-bash if you want to run a fixed version, please install the latest snapshot.

dscho added a commit to git-for-windows/build-extra that referenced this issue Nov 19, 2020
Beyond Compare 4 [can be configured as difftool `bc4`
again](git-for-windows/git#2893).

Signed-off-by: Johannes Schindelin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants