git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>, David Aguilar <davvid@gmail.com>
Cc: 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: Mon, 24 Feb 2014 21:10:32 +0000	[thread overview]
Message-ID: <530BB548.3050603@web.de> (raw)
In-Reply-To: <xmqqr46s9yzx.fsf@gitster.dls.corp.google.com>

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
+	)
+'
+
 test_done

  reply	other threads:[~2014-02-24 21:10 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 [this message]
2014-02-25 18:02     ` Junio C Hamano
2014-02-25 20:34       ` Jens Lehmann
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=530BB548.3050603@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).