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

Re: [PATCH] Ignore file filter

From
David Greaves <david@dgreaves.com>
Date
May 13, 2005, 08:50 UTC
Message-ID
<42846A3F.4030706@dgreaves.com>
In-Reply-To
<7v64xodshs.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 14 quoted lines
>Just a half theoretical question.  How well does this perform
>when your filenames have:
>
>    - ' '  (ASCII 0x20)
>    - '\t' (ASCII 0x09)
>    - '\n' (ASCII 0x0a)
>    - '`'  (ASCII 0x60) backtick
>    - '$'  (ASCII 0x24) dollar sign
>
>in them?  Or is it the case that the rest of the Cogito is not
>careful enough and it does not matter to be careful only in this
>script?
>  
>

That's what the: zerosep=$'-d "\0"' is for. It looks like the shell 'read' doesn't honour it though - I couldn't make it work.

However, thanks, after I fixed the quotes I missed in: -o \( $pass_files -eq 1 -a -f "$file" \) \ -o \( $pass_dirs -eq 1 -a -d "$file" \) \ -o \( $pass_links -eq 1 -a -h "$file" \) \

it handles all cases above except \n (of course)

Frankly I think we're beyond shell programming and we should be using perl (IMHO as the 'best' and most portable text handler) It also has a *fantastic* test harness available.

David
Previous: David Greaves
Message 18 of 18 in “Ignore file filter”
  1. Ignore file filterDavid Greaves, May 12, 2005
  2. Petr BaudisMay 13, 2005
  3. David GreavesMay 14, 2005
  4. Junio C HamanoMay 14, 2005
  5. Petr BaudisMay 14, 2005
  6. David GreavesMay 14, 2005
  7. [RFD] Ignore rulesPetr Baudis, May 14, 2005
  8. David GreavesMay 14, 2005
  9. Junio C HamanoMay 14, 2005
  10. Jon SeymourMay 15, 2005
  11. Junio C HamanoMay 15, 2005
  12. Junio C HamanoMay 15, 2005
  13. [RFD] git-run-with-user-pathJunio C Hamano, May 15, 2005
  14. Matthias UrlichsMay 16, 2005
  15. David GreavesMay 16, 2005
  16. Petr BaudisMay 14, 2005
  17. David GreavesMay 14, 2005
  18. David GreavesMay 13, 2005

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.