All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Stefan Beller <sbeller@google.com>
Cc: andreenkosa@gmail.com, Junio C Hamano <gitster@pobox.com>,
	git <git@vger.kernel.org>
Subject: Re: [PATCH] diff: don't attempt to strip prefix from absolute Windows paths
Date: Thu, 18 Oct 2018 21:11:48 +0200	[thread overview]
Message-ID: <a9a51e28-208d-d8dd-a868-bc2f8cc79598@kdbg.org> (raw)
In-Reply-To: <CAGZ79kYChLNDB_f1KR2k7G9FvHkX7x_yXdhxMRpLFWpRR0SoPg@mail.gmail.com>

Am 18.10.18 um 20:49 schrieb Stefan Beller:
> On Thu, Oct 18, 2018 at 11:38 AM Johannes Sixt <j6t@kdbg.org> wrote:
> 
>> There is one peculiarity, though: [...]
> 
> The explanation makes sense, and the code looks good.
> Do we want to have a test for this niche case?
> 

Good point. That would be the following. But give me a day or two to
cross-check on Windows and whether it really catches the breakage.

diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh
index 453e6c35eb..6e0dd6f9e5 100755
--- a/t/t4053-diff-no-index.sh
+++ b/t/t4053-diff-no-index.sh
@@ -127,4 +127,14 @@ test_expect_success 'diff --no-index from repo subdir respects config (implicit)
 	test_cmp expect actual.head
 '
 
+test_expect_success 'diff --no-index from repo subdir with absolute paths' '
+	cat <<-EOF >expect &&
+	1	1	$(pwd)/non/git/{a => b}
+	EOF
+	test_expect_code 1 \
+		git -C repo/sub diff --numstat \
+		"$(pwd)/non/git/a" "$(pwd)/non/git/b" >actual &&
+	test_cmp expect actual
+'
+
 test_done

  reply	other threads:[~2018-10-18 19:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 18:23 issue: strange `git diff --numstat` behavior Sergey Andreenko
2018-10-13  8:13 ` Junio C Hamano
2018-10-18 18:38   ` [PATCH] diff: don't attempt to strip prefix from absolute Windows paths Johannes Sixt
2018-10-18 18:49     ` Stefan Beller
2018-10-18 19:11       ` Johannes Sixt [this message]
2018-10-19 16:58         ` [PATCH v2] " Johannes Sixt
2018-10-19 17:04           ` Stefan Beller
2018-10-19  1:34     ` [PATCH] " Junio C Hamano

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=a9a51e28-208d-d8dd-a868-bc2f8cc79598@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=andreenkosa@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sbeller@google.com \
    --subject='Re: [PATCH] diff: don'\''t attempt to strip prefix from absolute Windows paths' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.