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

Re: [PATCH 2/2] pathspec: allow escaped query values

From
BWBrandon Williams <bmwill@google.com>
Date
Mar 10, 2017, 18:53 UTC
Message-ID
<20170310185332.GC53198@google.com>
In-Reply-To
<a81ad8b5-3b49-8232-1656-66b2e9d78569@google.com>
On 03/09, Jonathan Tan wrote:
Show 21 quoted lines
> On 03/09/2017 01:07 PM, Brandon Williams wrote:
> >diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
> >index b5e5a0607..585d17bad 100755
> >--- a/t/t6135-pathspec-with-attrs.sh
> >+++ b/t/t6135-pathspec-with-attrs.sh
> >@@ -178,4 +178,13 @@ test_expect_success 'abort on asking for wrong magic' '
> > 	test_must_fail git ls-files . ":(attr:!label=foo)"
> > '
> >
> >+test_expect_success 'check attribute list' '
> >+	cat <<-EOF >>.gitattributes &&
> >+	* whitespace=indent,trail,space
> >+	EOF
> >+	git ls-files ":(attr:whitespace=indent\,trail\,space)" >actual &&
> >+	git ls-files >expect &&
> >+	test_cmp expect actual
> >+'
> >+
> > test_done
> 
> Is there a way to verify that `\,` is not escaped by the shell into `,`?

You can run with GIT_TRACE=1 to see the actual string passed to git. '\,' is indeed passed to git with no problems.

> 
> Maybe also add tests that show \ as the last character and \
> escaping another \.
Done
-- 
Brandon Williams
Previous: Jonathan TanNext: Stefan Beller
Message 9 of 23 in “bringing attributes to pathspecs”
  1. 0/2 bringing attributes to pathspecsBrandon Williams, Mar 9, 2017
  2. 1/2 pathspec: allow querying for attributesBrandon Williams, Mar 9, 2017
  3. Jonathan TanMar 9, 2017
  4. Brandon WilliamsMar 10, 2017
  5. Junio C HamanoMar 13, 2017
  6. Stefan BellerMar 13, 2017
  7. 2/2 pathspec: allow escaped query valuesBrandon Williams, Mar 9, 2017
  8. Jonathan TanMar 9, 2017
  9. Brandon WilliamsMar 10, 2017
  10. Stefan BellerMar 9, 2017
  11. 0/2 bringing attributes to pathspecsBrandon Williams, Mar 10, 2017
  12. 1/2 pathspec: allow querying for attributesBrandon Williams, Mar 10, 2017
  13. Jonathan TanMar 10, 2017
  14. Brandon WilliamsMar 11, 2017
  15. 2/2 pathspec: allow escaped query valuesBrandon Williams, Mar 10, 2017
  16. 0/2 bringing attributes to pathspecsBrandon Williams, Mar 13, 2017
  17. 1/2 pathspec: allow querying for attributesBrandon Williams, Mar 13, 2017
  18. 2/2 pathspec: allow escaped query valuesBrandon Williams, Mar 13, 2017
  19. Junio C HamanoMar 13, 2017
  20. Brandon WilliamsMar 13, 2017
  21. Duy NguyenMar 21, 2017
  22. Junio C HamanoMar 21, 2017
  23. Brandon WilliamsMar 21, 2017

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.