path: root/contrib/fast-import
diff options
authorPete Wyckoff <>2011-12-25 02:07:40 (GMT)
committerJunio C Hamano <>2011-12-27 18:19:31 (GMT)
commit28755dbaa5213032b2da202652c214a9f94ff853 (patch)
tree68af619b99ccd56db44d4800fc2528b8812932aa /contrib/fast-import
parent09fca77b9ecd64e2008835208bab29e15a4b2809 (diff)
git-p4: document and test submit options
Clarify there is a -M option, but no -C. These are both configurable through variables. Explain that the allowSubmit variable takes a comma-separated list of branch names. Catch earlier an invalid branch name given as an argument to "git p4 clone". Test option --origin, variable allowSubmit, and explicit master branch name. Signed-off-by: Pete Wyckoff <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'contrib/fast-import')
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 5420bf1..d3c3ad8 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -362,6 +362,11 @@ def isValidGitDir(path):
def parseRevision(ref):
return read_pipe("git rev-parse %s" % ref).strip()
+def branchExists(ref):
+ rev = read_pipe(["git", "rev-parse", "-q", "--verify", ref],
+ ignore_error=True)
+ return len(rev) > 0
def extractLogMessageFromGitCommit(commit):
logMessage = ""
@@ -1089,6 +1094,8 @@ class P4Submit(Command, P4UserMap):
die("Detecting current git branch failed!")
elif len(args) == 1:
self.master = args[0]
+ if not branchExists(self.master):
+ die("Branch %s does not exist" % self.master)
return False