git p4: avoid shell when invoking git rev-list

Invoke git rev-list directly, avoiding the shell, in
P4Submit and P4Sync.  The overhead of starting extra
processes is significant in cygwin; this speeds things
up on that platform.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Pete Wyckoff 2013-01-26 22:11:21 -05:00 committed by Junio C Hamano
parent 9bf2885510
commit c7d34884ae

View File

@ -1606,7 +1606,7 @@ class P4Submit(Command, P4UserMap):
self.check() self.check()
commits = [] commits = []
for line in read_pipe_lines("git rev-list --no-merges %s..%s" % (self.origin, self.master)): for line in read_pipe_lines(["git", "rev-list", "--no-merges", "%s..%s" % (self.origin, self.master)]):
commits.append(line.strip()) commits.append(line.strip())
commits.reverse() commits.reverse()
@ -2644,7 +2644,8 @@ class P4Sync(Command, P4UserMap):
def searchParent(self, parent, branch, target): def searchParent(self, parent, branch, target):
parentFound = False parentFound = False
for blob in read_pipe_lines(["git", "rev-list", "--reverse", "--no-merges", parent]): for blob in read_pipe_lines(["git", "rev-list", "--reverse",
"--no-merges", parent]):
blob = blob.strip() blob = blob.strip()
if len(read_pipe(["git", "diff-tree", blob, target])) == 0: if len(read_pipe(["git", "diff-tree", blob, target])) == 0:
parentFound = True parentFound = True