git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] git-p4: fix sync new branch regression

From
PWPete Wyckoff <pw@padd.com>
Date
Mar 16, 2011, 20:52 UTC
Message-ID
<20110316205246.GA23387@arf.padd.com>
In-Reply-To
<20110316205008.GA22702@arf.padd.com>

e32e00d (git-p4: better message for "git-p4 sync" when not cloned, 2011-02-19) broke another use case, that of using "git-p4 sync" to import a new branch into an existing repository.

Refine the fix again, on top of the fix in ac34efc.
Reported-by: Michael Horowitz <michael.horowitz@ieee.org>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Tested-by: Michael Horowitz <michael.horowitz@ieee.org>
---
 contrib/fast-import/git-p4 |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 7cb479c..2eacb95 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1763,7 +1763,9 @@ class P4Sync(Command):
 
                 changes.sort()
             else:
-                if not isinstance(self, P4Clone) and not self.p4BranchesInGit:
+                # catch "git-p4 sync" with no new branches, in a repo that
+                # does not have any existing git-p4 branches
+                if len(args) == 0 and not self.p4BranchesInGit:
                     die("No remote p4 branches.  Perhaps you never did \"git p4 clone\" in here.");
                 if self.verbose:
                     print "Getting p4 changes for %s...%s" % (', '.join(self.depotPaths),
-- 
1.7.4.1
Previous: Pete WyckoffNext: Pete Wyckoff
Message 2 of 3 in “git-p4: sync new branch regression”
  1. 0/2 git-p4: sync new branch regressionPete Wyckoff, Mar 16, 2011
  2. 1/2 git-p4: fix sync new branch regressionPete Wyckoff, Mar 16, 2011
  3. 2/2 git-p4: test sync new branchPete Wyckoff, Mar 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.