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>
Pete Wyckoff committed
Jan 26, 2013 at 22:11 UTC
c7d34884ae1d37e910ce6813c9baeb06c0912228
1 file changed
+3
-2
git-p4.py
+3
-2
@@ -1606,7 +1606,7 @@ class P4Submit(Command, P4UserMap):
1606
self.check()
1607
1608
commits = []
1609
- for line in read_pipe_lines("git rev-list --no-merges %s..%s" % (self.origin, self.master)):
1609
+ for line in read_pipe_lines(["git", "rev-list", "--no-merges", "%s..%s" % (self.origin, self.master)]):
1610
commits.append(line.strip())
1611
commits.reverse()
1612
@@ -2644,7 +2644,8 @@ class P4Sync(Command, P4UserMap):
2644
2645
def searchParent(self, parent, branch, target):
2646
parentFound = False
2647
- for blob in read_pipe_lines(["git", "rev-list", "--reverse", "--no-merges", parent]):
2647
+ for blob in read_pipe_lines(["git", "rev-list", "--reverse",
2648
+ "--no-merges", parent]):
2649
blob = blob.strip()
2650
if len(read_pipe(["git", "diff-tree", blob, target])) == 0:
2651
parentFound = True