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

Re: [PATCH] git-rm: Fix to properly handle files with spaces, tabs, newlines, etc.

From
Alex Riesen <raa.lkml@gmail.com>
Date
Feb 24, 2006, 13:23 UTC
Message-ID
<81b0412b0602240523l1b10c910q6e5d2e3cef82e306@mail.gmail.com>
In-Reply-To
<8764n7rl6s.wl%cworth@cworth.org>
On 2/23/06, Carl Worth <cworth@cworth.org> wrote:
Show 6 quoted lines
> +# Setup some files to be removed, some with funny characters
> +touch -- foo bar baz 'space embedded' 'tab     embedded' 'newline
> +embedded' -q
> +git-add -- foo bar baz 'space embedded' 'tab   embedded' 'newline
> +embedded' -q
> +git-commit -m "add files"
This doesn't work on some exotic filesystems (ntfs and fat):
*** t3600-rm.sh ***
touch: cannot touch `tab\tembedded': No such file or directory
touch: cannot touch `newline\nembedded': No such file or directory
error: pathspec 'tab    embedded' did not match any.
error: pathspec 'newline
embedded' did not match any.
Maybe you misspelled it?
Nothing to commit
* FAIL 1: Pre-check that foo exists and is in index before git-rm foo
        [ -f foo ] && git-ls-files --error-unmatch foo
* FAIL 2: Test that git-rm foo succeeds
        git-rm foo
* FAIL 4: Pre-check that bar exists and is in index before "git-rm -f bar"
        [ -f bar ] && git-ls-files --error-unmatch bar
* FAIL 5: Test that "git-rm -f bar" succeeds
        git-rm -f bar
* FAIL 6: Post-check that bar does not exist and is not in index after
"git-rm -f bar"
        ! [ -f bar ] && ! git-ls-files --error-unmatch bar
* FAIL 7: Test that "git-rm -- -q" succeeds (remove a file that looks
like an option)
        git-rm -- -q
* FAIL 8: Test that "git-rm -f" succeeds with embedded space, tab, or
newline characters.
        git-rm -f 'space embedded' 'tab embedded' 'newline
        embedded'
* FAIL 10: When the rm in "git-rm -f" fails, it should not remove the
file from the index
        git-ls-files --error-unmatch baz
* failed 8 among 10 test(s)
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 15 in “Add new git-rm command with documentation”
  1. Add new git-rm command with documentationCarl Worth, Feb 21, 2006
  2. Krzysiek PawlikFeb 21, 2006
  3. Shawn PearceFeb 21, 2006
  4. Krzysiek PawlikFeb 21, 2006
  5. Shawn PearceFeb 21, 2006
  6. Krzysiek PawlikFeb 21, 2006
  7. Carl WorthFeb 21, 2006
  8. Carl WorthFeb 21, 2006
  9. Junio C HamanoFeb 22, 2006
  10. git-rm: Fix to properly handle files with spaces, tabs, newlines, etc.Carl Worth, Feb 23, 2006
  11. Carl WorthFeb 23, 2006
  12. Junio C HamanoFeb 23, 2006
  13. Alex RiesenFeb 24, 2006
  14. Junio C HamanoFeb 25, 2006
  15. Johannes SchindelinFeb 21, 2006

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.