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

Re: [PATCH] Have tests and programs understand paths containing spaces

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 23, 2008, 07:13 UTC
Message-ID
<480EE180.1050202@viscovery.net>
In-Reply-To
<20080422212801.GB20417@regex.yaph.org>
Arjen Laarhoven schrieb:
> A lot of tests and some core programs didn't work when used in a path
> containing whitespace.  Correct the quoting of all affected programs to
> fix this.

Please separate fixes of core programs/scripts from fixes of the tests (because the former have a much higher chance of being accepted).

But see these threads first:

http://thread.gmane.org/gmane.comp.version-control.git/60544 http://thread.gmane.org/gmane.comp.version-control.git/79057

Here a few comments:
> +GIT_DIR="$PWD/.git"
> +GIT_SVN_DIR="$GIT_DIR/svn/git-svn"
> +SVN_TREE="$GIT_SVN_DIR/svn-tree"
> +svnrepo="$PWD/svnrepo"
These are unnecessary: RHS of an assignment does not undergo word splitting.
> -test_expect_success "checkout from svn" "svn co $svnrepo '$SVN_TREE'"
> +test_expect_success "checkout from svn" "svn co '$svnrepo' '$SVN_TREE'"
> -	git diff help $SVN_TREE/exec-2.sh"
> +	git diff help '$SVN_TREE'/exec-2.sh"

These changes protect *only* against space-in-name, but not random-special-character-in-name. The proper fix is to change the quoting from

  test_expect_success "..." "... $svnrepo ..."
to
  test_expect_success '...' '... "$svnrepo" ...'
-- Hannes
Previous: Dmitry Potapov
Message 3 of 3 in “Have tests and programs understand paths containing spaces”
  1. Have tests and programs understand paths containing spacesArjen Laarhoven, Apr 22, 2008
  2. Dmitry PotapovApr 22, 2008
  3. Johannes SixtApr 23, 2008

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.