[PATCHv2 17/21] git p4: avoid shell when mapping users
- From
- Pete Wyckoff <pw@padd.com>
- Date
- Jan 27, 2013, 03:11 UTC
- Message-ID
- <1359256284-5660-18-git-send-email-pw@padd.com>
- In-Reply-To
- <1359256284-5660-1-git-send-email-pw@padd.com>
The extra quoting and double-% are unneeded, just to work around the shell. Instead, avoid the shell indirection.
Signed-off-by: Pete Wyckoff <pw@padd.com> --- git-p4.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-p4.py b/git-p4.py index a989704..c43d044 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1050,7 +1050,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.8.1.1.460.g6fa8886