summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77190eb)
raw | patch | inline | side by side (parent: 77190eb)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 22 Dec 2007 17:45:10 +0000 (09:45 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 22 Dec 2007 18:26:08 +0000 (10:26 -0800) |
When git-tag and git-commit launches the editor, they used to
honor EDITOR="editor -options args..." but recent rewrite in C
insisted on $EDITOR to be the path to the editor executable.
This restores the older behaviour.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
honor EDITOR="editor -options args..." but recent rewrite in C
insisted on $EDITOR to be the path to the editor executable.
This restores the older behaviour.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-tag.c | patch | blob | history |
diff --git a/builtin-tag.c b/builtin-tag.c
index 020ee1cb777d666fc2c70f87f01081355c061424..03e70155fc676a8dd38ca5cef800ed4a446e921a 100644 (file)
--- a/builtin-tag.c
+++ b/builtin-tag.c
editor = "vi";
if (strcmp(editor, ":")) {
- const char *args[] = { editor, path, NULL };
+ size_t len = strlen(editor);
+ int i = 0;
+ const char *args[6];
+
+ if (strcspn(editor, "$ \t'") != len) {
+ /* there are specials */
+ args[i++] = "sh";
+ args[i++] = "-c";
+ args[i++] = "$0 \"$@\"";
+ }
+ args[i++] = editor;
+ args[i++] = path;
+ args[i] = NULL;
if (run_command_v_opt_cd_env(args, 0, NULL, env))
die("There was a problem with the editor %s.", editor);