Skip to content

Commit

Permalink
git p4: avoid shell when invoking git rev-list
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pete Wyckoff authored and Junio C Hamano committed Jan 27, 2013
1 parent 9bf2885 commit c7d3488
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ def run(self, args):
self.check()

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.reverse()

Expand Down Expand Up @@ -2644,7 +2644,8 @@ def importNewBranch(self, branch, maxChange):

def searchParent(self, parent, branch, target):
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()
if len(read_pipe(["git", "diff-tree", blob, target])) == 0:
parentFound = True
Expand Down

0 comments on commit c7d3488

Please sign in to comment.