From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "David Aguilar" <davvid@gmail.com>,
git@vger.kernel.org, "Gábor Lipták" <gabor.liptak@gmail.com>,
"John Keeping" <john@keeping.me.uk>
Subject: Re: [PATCH] difftool: support repositories with .git-files
Date: Tue, 25 Feb 2014 20:34:30 +0000 [thread overview]
Message-ID: <530CFE56.6040807@web.de> (raw)
In-Reply-To: <xmqq1tyr6pfw.fsf@gitster.dls.corp.google.com>
Am 25.02.2014 18:02, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
>
>> Am 24.02.2014 17:55, schrieb Junio C Hamano:
>>> David Aguilar <davvid@gmail.com> writes:
>>>
>>>> Modern versions of "git submodule" use .git-files to setup the
>>>> submodule directory. When run in a "git submodule"-created
>>>> repository "git difftool --dir-diff" dies with the following
>>>> error:
>>>>
>>>> $ git difftool -d HEAD~
>>>> fatal: This operation must be run in a work tree
>>>> diff --raw --no-abbrev -z HEAD~: command returned error: 128
>>>>
>>>> core.worktree is relative to the .git directory but the logic
>>>> in find_worktree() does not account for it.
>>>>
>>>> Use `git rev-parse --show-toplevel` to find the worktree so that
>>>> the dir-diff feature works inside a submodule.
>>>>
>>>> Reported-by: Gábor Lipták <gabor.liptak@gmail.com>
>>>> Helped-by: Jens Lehmann <jens.lehmann@web.de>
>>>> Helped-by: John Keeping <john@keeping.me.uk>
>>>> Signed-off-by: David Aguilar <davvid@gmail.com>
>>>> ---
>>>
>>> Looks good; thanks.
>>
>>
>> FWIW:
>> Tested-by: Jens Lehmann <jens.lehmann@web.de>
>>
>> What about squashing this in to detect any future regressions?
>>
>> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
>> index 2418528..d86ad68 100755
>> --- a/t/t7800-difftool.sh
>> +++ b/t/t7800-difftool.sh
>> @@ -434,4 +434,12 @@ test_expect_success PERL 'difftool --no-symlinks detects conflict ' '
>> )
>> '
>>
>> +test_expect_success PERL 'difftool properly honours gitlink and core.worktree' '
>> + git submodule add ./. submod/ule &&
>> + (
>> + cd submod/ule &&
>> + git difftool --tool=echo --dir-diff --cached
>
> In the context of this fix, finishing with 0 exit status may be all
> we care about, but do we also care about things like in what
> directory the tool is invoked in, what arguments and extra
> environment settings (if any) it is given, and stuff like that?
Sure. But I just intended to test the fix (and the test can easily
be extended by people who know more about difftool than I do).
> In fact, the "echo" in the above is very misleading. The test
> relies on the fact that immediately after the submod/ule is cloned,
> "diff --cached" does not have to call any tool backend---if you
> modify some tracked file in its working tree and dropped --cached
> on the command line, the command will fail with "Huh? I do not know
> what 'echo' diff/merge backend is", no?
Right, using echo was not the best choice here. I used it to avoid
the dependency to meld in the example of the OP (maybe using "true"
as tool would have indicated that the tool is not important here,
but looking into this again a simple "git difftool --dir-diff"
without any further arguments also shows that the fix is working).
Aas mentioned above, I'm not familiar with difftool and just wanted
to share an easy way to test the fix. But I do not care too deeply
about this test, so feel free to ignore it.
next prev parent reply other threads:[~2014-02-25 20:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 3:12 [PATCH] difftool: support repositories with .git-files David Aguilar
2014-02-24 17:55 ` Junio C Hamano
2014-02-24 21:10 ` Jens Lehmann
2014-02-25 18:02 ` Junio C Hamano
2014-02-25 20:34 ` Jens Lehmann [this message]
2014-02-25 22:12 ` Junio C Hamano
2014-02-27 21:12 ` Jens Lehmann
2014-03-05 9:23 ` [PATCH] t7800: add a difftool test for .git-files David Aguilar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530CFE56.6040807@web.de \
--to=jens.lehmann@web.de \
--cc=davvid@gmail.com \
--cc=gabor.liptak@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=john@keeping.me.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).