Re: [PATCH 3/8] git-send-email.perl: Handle shell metacharacters in $EDITOR properly

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Johannes Sixt <j.sixt@...>
Cc: <git@...>, Adam Roben <aroben@...>, <gitster@...>
Date: Wednesday, April 9, 2008 - 10:28 am

On Wed, Apr 09, 2008 at 08:31:18AM +0200, Johannes Sixt wrote:

This fixes the git-send-perl semantics for launching an editor when
$GIT_EDITOR (or friends) contains shell metacharacters to match
launch_editor() in builtin-tag.c. If we use the current approach
(sh -c '$0 $@' "$EDITOR" files ...), we see it fails when $EDITOR has
shell metacharacters:

$ sh -x -c '$0 $@' "$VISUAL" "foo"
+ "$FAKE_EDITOR" foo
"$FAKE_EDITOR": 1: "$FAKE_EDITOR": not found

Whereas builtin-tag.c will invoke sh -c "$EDITOR \"$@\"".

Note that with the method git-send-perl uses currently, it's difficult
(impossible?) to deal with a editor path that contains arbitrary shell
metacharacters. It's certainly impossible when the various git tools use
different semantics :)

I'll amend the commit message along with the other suggested changes.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 3/8] git-send-email.perl: Handle shell metacharac..., Bryan Donlan, (Wed Apr 9, 10:28 am)
[PATCH 4/8] test-lib.sh: Fix some missing path quoting, Bryan Donlan, (Tue Apr 8, 9:30 pm)
[PATCH 7/8] Use test_set_editor in t9001-send-email.sh, Bryan Donlan, (Tue Apr 8, 9:30 pm)