path: root/contrib/fast-import
diff options
authorVitor Antunes <>2011-08-18 23:44:04 (GMT)
committerJunio C Hamano <>2011-08-23 04:08:37 (GMT)
commit8ace74c00e87cbb16d7303761ff4f6b91505ee20 (patch)
tree8b40b4fa974f0a6632f0a2fc2bf90f65026a27d7 /contrib/fast-import
parent04d277b39e3e40f939fd7935c30beb48452015ec (diff)
git-p4: Allow filtering Perforce branches by user
All branches in the Perforce server are downloaded to allow branch detection. If you have a centralized server on a remote location and there is a big number of branches this operation can take some time. This patch adds the configuration option git-p4.branchUser to allow filtering the branch list by user. Although this limits the branch maintenance in Perforce to be done by a single user, it might be an advantage when the number of branches being used in a specific depot is very small when compared with the branches available in the server. Signed-off-by: Vitor Antunes <> Acked-by: Pete Wyckoff <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/fast-import')
2 files changed, 13 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 72a5b6c..6314c20 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1455,7 +1455,13 @@ class P4Sync(Command, P4UserMap):
def getBranchMapping(self):
lostAndFoundBranches = set()
- for info in p4CmdList("branches"):
+ user = gitConfig("git-p4.branchUser")
+ if len(user) > 0:
+ command = "branches -u %s" % user
+ else:
+ command = "branches"
+ for info in p4CmdList(command):
details = p4Cmd("branch -o %s" % info["branch"])
viewIdx = 0
while details.has_key("View%s" % viewIdx):
diff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt
index 2ffbccc..97b66b9 100644
--- a/contrib/fast-import/git-p4.txt
+++ b/contrib/fast-import/git-p4.txt
@@ -257,6 +257,12 @@ Perforce server. Will enable --find-copies-harder git argument.
git config [--global] git-p4.detectCopies true
+Only use branch specifications defined by the selected username.
+ git config [--global] git-p4.branchUser username
Implementation Details...