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

Re: [PATCH 1/2] filter-branch: provide the convenience functions also for commit filters

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 19, 2007, 01:16 UTC
Message-ID
<Pine.LNX.4.64.0707190215460.14781@racer.site>
In-Reply-To
<7vfy3l5jo4.fsf@assigned-by-dhcp.cox.net>
Hi,
On Wed, 18 Jul 2007, Junio C Hamano wrote:
Show 14 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > +this_script="$(cd "$(dirname "$0")"; pwd)"/$(basename "$0")
> > ...
> > +		filter_commit="SOURCE_FUNCTIONS=1 . \"$this_script\"; $OPTARG"
> 
> Hmmmmmm.
> 
> Care to enlighten why this is not just:
> 
> 	filter_commit="SOURCE_FUNCTIONS=1 . \"$0\"; $OPTARG"
> 
> Is it because you cd(1) around in the script, and it can be
> relative to where you started?
Yes.
Show 8 quoted lines
> In either case, are you quoting potential funnies (such as '"'
> or '\\') in "$0" sufficiently?  Exporting this_script variable,
> and changing the above to
> 
> 	filter_commit='SOURCE_FUNCTIONS=1 . "$this_script";'" $OPTARG"
> 
> to arrange the shell that is invoked with 'sh -c' to expand its
> value would make it smaller problem, I suspect.

Will do. You know, I do have my problems with correct quoting, and the way I did it in this patch was always good enough for me. Which does not mean much...

Ciao, Dscho

Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 4 in “filter-branch: provide the convenience functions also for commit filters”
  1. 1/2 filter-branch: provide the convenience functions also for commit filtersJohannes Schindelin, Jul 18, 2007
  2. Junio C HamanoJul 19, 2007
  3. Johannes SchindelinJul 19, 2007
  4. 1/2 filter-branch: provide the convenience functions also for commit filtersJohannes Schindelin, Jul 19, 2007

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.