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

[PATCH 17/21] git p4: avoid shell when mapping users

From: Pete Wyckoff <hidden>
Date: 2016-06-15 22:54:53
Subsystem: the rest · Maintainer: Linus Torvalds

The extra quoting and double-% are unneeded, just to work
around the shell.  Instead, avoid the shell indirection.

Signed-off-by: Pete Wyckoff <redacted>
---
 git-p4.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py
index a6806bc..a92d84f 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -982,7 +982,8 @@ class P4Submit(Command, P4UserMap):
     def p4UserForCommit(self,id):
         # Return the tuple (perforce user,git email) for a given git commit id
         self.getUserMapFromPerforceServer()
-        gitEmail = read_pipe("git log --max-count=1 --format='%%ae' %s" % id)
+        gitEmail = read_pipe(["git", "log", "--max-count=1",
+                              "--format=%ae", id])
         gitEmail = gitEmail.strip()
         if not self.emails.has_key(gitEmail):
             return (None,gitEmail)
-- 
1.7.12.1.403.g28165e1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help