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

Re: git-clean fails to remove a file whose name contains \\, ", or \n, TAB, etc.

From
Junio C Hamano <junkio@cox.net>
Date
May 8, 2007, 20:53 UTC
Message-ID
<7vbqgv2g1h.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<86k5vj9gzu.fsf@blue.stonehenge.com>
merlyn@stonehenge.com (Randal L. Schwartz) writes:
Show 15 quoted lines
>>>>>> "Jim" == Jim Meyering <jim@meyering.net> writes:
>
> Jim> Not that it matters (or maybe this is a feature :-), because people
> Jim> who create such files in their working directory deserve what they
> Jim> get, Eh? :-)
>
> The problem is the newline in the string, since
>
>   git-ls-files --others --directory $excl ${excl_info:+"$excl_info"} -- "$@" |
>   while read -r file; do
>
> is using newline as a delimiter.  Any file with a newline would mess this up.
>
> Not being a shell programming expert, is there a way we could use -z and xargs
> -0 here instead?

Funny that we had this discussed on this list a few days ago ;-).

Previous: Randal L. SchwartzNext: Jan Hudec
Message 3 of 8 in “git-clean fails to remove a file whose name contains \\, ", or \n, TAB, etc.”
  1. Jim MeyeringMay 8, 2007
  2. Randal L. SchwartzMay 8, 2007
  3. Junio C HamanoMay 8, 2007
  4. Jan HudecMay 8, 2007
  5. Randal L. SchwartzMay 8, 2007
  6. Karl HasselströmMay 8, 2007
  7. Randal L. SchwartzMay 8, 2007
  8. Karl HasselströmMay 8, 2007

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.