Hi,

I would have expected this new version comparison to be the default
behavior and to compare local files only if one commit is specified.
I'm on mobile. Can you verify if that might have changed also. If not,
wouldn't this be good for you?

git difftool {commitsha} -- {file}

Thanks,
Alex

On Sat, Aug 11, 2018, 22:06 Michael Sabin <jpsx...@gmail.com> wrote:

> Hello,
>
> I've identified a change in the behavior of "git difftool" between Git
> v2.14 and later versions of Git.
>
> In Git v2.14.*, when you use it like this
> git difftool ${sha1} ${sha2} ${some_file}
> and ${sha1} or ${sha2} point to HEAD and the working version of the file
> is unchanged,
> the difftool will be given the actual working path of that file instead of
> a temp file.
>
> After v2.14, the difftool is given a temporary copy of the file on both
> sides.
>
> I've made several Google searches and reviewed several release notes, but
> can find no direct reference to this change.
> This change has made working with Git often inconvenient.
> Is there any way to revert the behavior back to v2.14?
>
> Here are the detailed steps to reproduce the behavior:
>
> # Setup difftool
> git config --global diff.tool meld
> git config --global difftool.prompt false
>
> # Create a repo
> git init test-difftool
> cd test-difftool
> echo "first content" > test.txt
> git add .
> git commit -m "First"
> echo "second content" > test.txt
> git add .
> git commit -m "Second"
>
> # Show the log to get the sha's
> git log --oneline
>
> # The log will look something like this
> # Grab the {sha1} and {sha2} from the output
> {sha1} (HEAD -> master) Second
> {sha2} First
>
> # Finally run the difftool against the two sha's for the file
> git difftool {sha1} {sha2} test.txt
>
> # git version 2.14.4 result:
> # Left file is the working test.txt
> # Right file is a temp file
>
> # git versions after 2.14.4:
> # Left file is a temp file
> # Right file is a temp file
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to