Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:22

Possibly related (same subject, not in this thread)

Hi,

On Wed, 18 Jul 2007, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
+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.
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help