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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Randal L. Schwartz
Date: Tuesday, May 8, 2007 - 1:51 pm

>>>>> "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?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: git-clean fails to remove a file whose name contains \ ..., Randal L. Schwartz, (Tue May 8, 1:51 pm)
Re: git-clean fails to remove a file whose name contains \ ..., Randal L. Schwartz, (Tue May 8, 4:18 pm)
Re: git-clean fails to remove a file whose name contains \ ..., Randal L. Schwartz, (Tue May 8, 4:29 pm)