Re: git fails with control characters in trunk directory name
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- May 12, 2009, 17:41 UTC
- Message-ID
- <20090512174122.GB32594@blimp.localdomain>
- In-Reply-To
- <200905121900.00625.Hugo.Mildenberger@namir.de>
Hugo Mildenberger, Tue, May 12, 2009 18:59:58 +0200:
Show 17 quoted lines
> > > I looked into guess_dir_name(). > > > > That's not the right place. The place I meant is right below the call > > to this function (you have to parse the names given in the command-line > > too). > > > > The automatically generated (that's the case with guess_dir_name) > > directory name certainly shouldn't contain any unexpected characters. > > > > > A regex call would be easy to fit, but > > > currently the git binary does not depend on libpcre. Is it generally > > > considered to be acceptable to add such a dependency? > > > > No. And pcre is not the only regex lib in the world. And we prefer > > shell patterns, if any at all. > > You really want to use shell patterns to match against a string from within a binary?
Is that a problem? Especially if the matching expression is just something like a character class?
> Although git already makes use of regexec from glibc or compat/regex > directory in numerous places?
You said pcre, and I wasn't able to look at the source at the time I answered your mail to check if git relies on POSIX regexp. I did (and remembered git grep), so no need for pcre and regular exceptions are just a line away.
P.S. Could you please quote more appropriately? Your discussion is a little hard to follow.