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

Re: [PATCH 08/10] t2200, t7004: Avoid glob pattern that also matches files

From
Johannes Sixt <j6t@kdbg.org>
Date
Mar 19, 2009, 19:52 UTC
Message-ID
<200903192052.43162.j6t@kdbg.org>
In-Reply-To
<7v7i2mbap2.fsf@gitster.siamese.dyndns.org>
On Donnerstag, 19. März 2009, Junio C Hamano wrote:
Show 16 quoted lines
> Johannes Sixt <j6t@kdbg.org> writes:
> > On Windows, there is an unfortunate interaction between the MSYS bash and
> > git's command line processing:
> >
> > - Since Windows's CMD does not do the wildcard expansion, but passes
> >   arguments like path* through to the programs, the programs must do the
> >   expansion themselves. This happens in the startup code before main() is
> >   entered.
> >
> > - bash, however, passes the argument "path*" to git, assuming that git
> > will see the unquoted word unchanged as a single argument.
> >
> > But actually git expands the unquoted word before main() is entered.
>
> Doesn't this mean on Windows, the glob pathspec git supports is not useful
> at all?
No, it is still useful. There is a difference if I say
   git add "*a*"

from bash or from Windows's CMD. The latter passes the argument to git with the dquotes; the startup code removes them and does not expand the wildcard. But if bash invokes the command, bash removes the quotes, so that the startup code only sees *a* and does the expansion.

Show 10 quoted lines
> > In t2200, not all names that the test case is interested in exist as
> > files at the time when 'git ls-files' is invoked. git expands "path?" to
> > only the subset of files the exist, and only that subset was listed, so
> > that the test failed.  We now list all interesting paths explicitly.
>
> But that conversion misses the whole point of that particular test,
> doesn't it?  It wants to see path2 that was unmerged and existed only in
> the index but not in the work tree has disappeared, while the similarly
> unmerged path1 resolved after "add -u".  IOW, you are not testing that
> "add -u" notices a removal of path2 from the work tree anymore.
I see. Then I'll just add path2 to the list, OK? It still passes the test.
-- Hannes
Previous: Junio C HamanoNext: Junio C Hamano
Message 20 of 27 in “Test on Windows - prequel”
  1. 00/11 Test on Windows - prequelJohannes Sixt, Mar 18, 2009
  2. 01/10 t9400, t9401: Do not force hard-linked cloneJohannes Sixt, Mar 18, 2009
  3. 02/10 test suite: Use 'say' to say something instead of 'test_expect_success'Johannes Sixt, Mar 18, 2009
  4. Johannes SchindelinMar 18, 2009
  5. Johannes SixtMar 19, 2009
  6. Johannes SchindelinMar 19, 2009
  7. Junio C HamanoMar 19, 2009
  8. 03/10 Call 'say' outside test_expect_successJohannes Sixt, Mar 18, 2009
  9. 04/10 test-lib: Replace uses of $(expr ...) by POSIX shell features.Johannes Sixt, Mar 18, 2009
  10. Johannes SchindelinMar 18, 2009
  11. Johannes SixtMar 19, 2009
  12. Johannes SchindelinMar 19, 2009
  13. 05/10 test-lib: Simplify test counting.Johannes Sixt, Mar 18, 2009
  14. Johannes SchindelinMar 18, 2009
  15. Johannes SixtMar 19, 2009
  16. 06/10 test-lib: Introduce test_chmod and use it instead of update-index --chmodJohannes Sixt, Mar 18, 2009
  17. 07/10 t7300: fix clean up on WindowsJohannes Sixt, Mar 18, 2009
  18. 08/10 t2200, t7004: Avoid glob pattern that also matches filesJohannes Sixt, Mar 18, 2009
  19. Junio C HamanoMar 19, 2009
  20. Johannes SixtMar 19, 2009
  21. Junio C HamanoMar 19, 2009
  22. 09/10 t5300, t5302, t5303: Do not use /dev/zeroJohannes Sixt, Mar 18, 2009
  23. 10/10 t5602: Work around path mangling on MSYSJohannes Sixt, Mar 18, 2009
  24. Junio C HamanoMar 18, 2009
  25. Johannes SixtMar 19, 2009
  26. Johannes SixtMar 19, 2009
  27. Junio C HamanoMar 19, 2009

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.