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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 20, 2010, 17:59 UTC
Message-ID
<7v8vzkcol8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20101220160911.GA32136@honk.padd.com>
Pete Wyckoff <pw@padd.com> writes:
> This version of the patch handles quoting of shell
> meta-characters, as pointed out by Hannes.  I decided to invoke
> sq_quote_buf directly on the path before expanding %s, rather
> than writing a dict entry to understand %'s.

Ahh, that's much more preferable than my horrible suggestion ;-) If the user wants to have concatenation with other parameters, that can be left to the shell that is invoked, e.g. "--clean foo/%s" for "hello world.c" would expand to "--clean foo/'hello world.c'" and does what we want.

Another nitpick is if 's' is the right letter to use for the pathname information. I think you took 's' after "string", but if this is to be extensible, you should anticipate that later there will be other kinds of information you may want to throw at the filters, and expect that some of them also will be of type "string", and you will have painted the person who wants to add that new information into a tight corner as you already took the valuable 's'.

Which would suggest that you shouldn't be naming the placeholder after the type but after what the placeholder means, no? Perhaps %f (for filename) would be a better choice?

Previous: Pete WyckoffNext: Pete Wyckoff
Message 7 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.