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

Re: [PATCH] convert filter: supply path to external driver

From
PWPete Wyckoff <pw@padd.com>
Date
Dec 20, 2010, 14:41 UTC
Message-ID
<20101220144159.GB30945@honk.padd.com>
In-Reply-To
<4D0F0DFB.20502@viscovery.net>
j.sixt@viscovery.net wrote on Mon, 20 Dec 2010 09:04 +0100:
Show 17 quoted lines
> Am 12/19/2010 22:29, schrieb Pete Wyckoff:
> > Filtering to support keyword expansion may need the name of
> > the file being filtered.  In particular, to support p4 keywords
> > like
> > 
> >     $File: //depot/product/dir/script.sh $
> > 
> > the smudge filter needs to know the name of the file it is
> > smudging.
> > 
> > Add a "%s" conversion specifier to the gitattribute for filter.
> > It will be expanded with the path name to the file when invoking
> > the external filter command.
> 
> What happens if there are any shell special characters in the path name
> (or spaces, for that matter). Does this shell-escape the substituted path
> name anywhere in the call chain?

Good catch---it doesn't. I'll see if running everything through sq_quote_buf will help.

Incidentally there appears to be no way to quote spaces in filenames listed in .gitattributes, although fnmatch wildcards can be used to work around that.

		-- Pete
Previous: Junio C Hamano
Message 17 of 17 in “smudge/clean filter needs filename”
  1. Pete WyckoffDec 18, 2010
  2. convert filter: supply path to external driverPete Wyckoff, Dec 19, 2010
  3. Junio C HamanoDec 19, 2010
  4. Jeff KingDec 20, 2010
  5. david@lang.hmDec 20, 2010
  6. convert filter: supply path to external driverPete Wyckoff, Dec 20, 2010
  7. Junio C HamanoDec 20, 2010
  8. convert filter: supply path to external driverPete Wyckoff, Dec 21, 2010
  9. Jonathan NiederDec 21, 2010
  10. convert filter: supply path to external driverPete Wyckoff, Dec 21, 2010
  11. Junio C HamanoDec 21, 2010
  12. convert filter: supply path to external driverPete Wyckoff, Dec 22, 2010
  13. Junio C HamanoDec 22, 2010
  14. Junio C HamanoDec 22, 2010
  15. Johannes SixtDec 20, 2010
  16. Junio C HamanoDec 20, 2010
  17. Pete WyckoffDec 20, 2010

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.