git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] diff: restrict pathspec limitations to diff b/f case only

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 20, 2013, 22:43 UTC
Message-ID
<xmqqvbzm66dt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1384910801-11125-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 10 quoted lines
> builtin_diff_b_f() needs a path, not pathspec. Other modes in diff
> can deal with pathspec just fine. But because of the current
> GUARD_PATHSPEC() location, other modes also reject :(glob) and
> :(icase).
>
> Move GUARD_PATHSPEC(), and the "path" assignment statement, which is
> the reason of this GUARD_PATHSPEC(), inside builtin_diff_b_f().
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
Makes sense.
Let me squash this in.
diff --git a/t/t6131-pathspec-icase.sh b/t/t6131-pathspec-icase.sh
index 8d4a7fc..a7c7ff5 100755
--- a/t/t6131-pathspec-icase.sh
+++ b/t/t6131-pathspec-icase.sh
@@ -100,4 +100,10 @@ test_expect_success 'match_pathspec_depth matches :(icase)bar with empty prefix'
 	test_cmp expect actual
 '
 
+test_expect_success '"git diff" can take magic :(icase) pathspec' '
+	echo FOO/BAR >expect &&
+	git diff --name-only HEAD^ HEAD -- ":(icase)foo/bar" >actual &&
+	test_cmp expect actual
+'
+
 test_done

Thanks.
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 2 of 8 in “diff: restrict pathspec limitations to diff b/f case only”
  1. diff: restrict pathspec limitations to diff b/f case onlyNguyễn Thái Ngọc Duy, Nov 20, 2013
  2. Junio C HamanoNov 20, 2013
  3. 1/2 glossary-content.txt: remove an obsolete paragrahNguyễn Thái Ngọc Duy, Nov 21, 2013
  4. 2/2 glossary-content.txt: fix documentation of "**" patternsNguyễn Thái Ngọc Duy, Nov 21, 2013
  5. Junio C HamanoNov 21, 2013
  6. Junio C HamanoNov 21, 2013
  7. Duy NguyenNov 22, 2013
  8. Junio C HamanoNov 22, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.