summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-05 19:17:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-06-05 19:17:38 (GMT)
commit9fb0a798a74509ddc17f7ba7390abce5981c20de (patch)
treeb6f7597e7f47939c0189f593bbd27018655a094c /git-p4.py
parent5455ee0573a22bb793a7083d593ae1ace909cd4c (diff)
parentf3b5b07c3c7a8494d78e975d689b6c4479e6b0f3 (diff)
downloadgit-9fb0a798a74509ddc17f7ba7390abce5981c20de.zip
git-9fb0a798a74509ddc17f7ba7390abce5981c20de.tar.gz
git-9fb0a798a74509ddc17f7ba7390abce5981c20de.tar.bz2
Merge branch 'ld/p4-editor-multi-words'
Unlike "$EDITOR" and "$GIT_EDITOR" that can hold the path to the command and initial options (e.g. "/path/to/emacs -nw"), 'git p4' did not let the shell interpolate the contents of the environment variable that name the editor "$P4EDITOR" (and "$EDITOR", too). Make it in line with the rest of Git, as well as with Perforce. * ld/p4-editor-multi-words: git-p4: tests: use test-chmtime in place of touch git-p4: fix handling of multi-word P4EDITOR git-p4: add failing test for P4EDITOR handling
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-p4.py b/git-p4.py
index 41a77e6..ca6bb95 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1248,7 +1248,7 @@ class P4Submit(Command, P4UserMap):
editor = os.environ.get("P4EDITOR")
else:
editor = read_pipe("git var GIT_EDITOR").strip()
- system([editor, template_file])
+ system(["sh", "-c", ('%s "$@"' % editor), editor, template_file])
# If the file was not saved, prompt to see if this patch should
# be skipped. But skip this verification step if configured so.