author | Bryan Donlan <bdonlan@fushizen.net> | |
Sun, 4 May 2008 05:37:53 +0000 (01:37 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 May 2008 21:17:00 +0000 (14:17 -0700) | ||
commit | 065096c2b558af80e670299621ff3ddc6839954c | |
tree | 0ee3405c9bdb02277c527efd7a6b4b29594b898c | tree | snapshot |
parent | e5c349ba112fc53832c757cef122297718d3a175 | commit | diff |
git-send-email.perl: Handle shell metacharacters in $EDITOR properly
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 \"$@\"".
Thus, this patch changes git-send-email.perl to use the same method as the
C utilities, and additionally updates t/t9001-send-email.sh to test for
this bug.
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 \"$@\"".
Thus, this patch changes git-send-email.perl to use the same method as the
C utilities, and additionally updates t/t9001-send-email.sh to test for
this bug.
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email.perl | diff | blob | history | |
t/t9001-send-email.sh | diff | blob | history |