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

Re: git-p4 clone @all error

From
PWPete Wyckoff <pw@padd.com>
Date
Nov 3, 2012, 23:13 UTC
Message-ID
<20121103231305.GB11267@padd.com>
In-Reply-To
<CABYiQp=1HEW=53U2Rck5vckhq0PB3C9iuanoXeVvNG6Xv5+oHg@mail.gmail.com>
merlin66b@gmail.com wrote on Wed, 31 Oct 2012 15:01 +0100:
Show 23 quoted lines
> On Tue, Oct 30, 2012 at 11:44 AM, Arthur <a.foulon@amesys.fr> wrote:
> > The problem :
> >
> > Importing revision 7727 (100%)Traceback (most recent call last):
> >   File "/usr/bin/git-p4", line 3183, in <module>
> >     main()
> >   File "/usr/bin/git-p4", line 3177, in main
> >     if not cmd.run(args):
> >   File "/usr/bin/git-p4", line 3048, in run
> >     if not P4Sync.run(self, depotPaths):
> >   File "/usr/bin/git-p4", line 2911, in run
> >     self.importChanges(changes)
> >   File "/usr/bin/git-p4", line 2618, in importChanges
> >     self.initialParent)
> >   File "/usr/bin/git-p4", line 2198, in commit
> >     epoch = details["time"]
> > KeyError: 'time'
> 
> Are you permanently converting a project, or are you planning to
> continue submitting to perforce with git-p4?
> 
> I have seen similar bugs myself when using the --detect-branches
> option.

I hope --detect-branches is unrelated to any problems related to p4 describe, because it is used identically both with and without the option. But you never know.

> The branch detection in git-p4 is flaky anyway: it is limited
> what it can handle, and it used to require correct perforce branch
> specs at least, so I would recommend not using it unless you know what
> it is doing under the hood.

It relies on heuristics because the git idea of branches doesn't have a direct analog in p4, even though p4 users will organize their files and directories in ways that suggest branches. The way it works is described in the BRANCH DETECTION part of the git-p4.1 man page.

The man page also explains how you can use a config variable to explicitly define the branch relationships. This might help:

git-p4.branchList::
        List of branches to be imported when branch detection is
        enabled.  Each entry should be a pair of branch names separated
        by a colon (:).  This example declares that both branchA and
        branchB were created from main:
	git config       git-p4.branchList main:branchA
	git config --add git-p4.branchList main:branchB

It still only works for branches at the same "level" of the depot path.

Show 6 quoted lines
> Instead I would just clone a single branch at a time (drop the
> --detect-branches) and work on that.
> 
> I do this even in the rare cases when I need more than one perforce
> branch in the same git repo - there are other ways to achieve the same
> thing.
Yep, that should alway works.
		-- Pete
Previous: Thomas BergNext: Arthur
Message 4 of 15 in “git-p4 clone @all error”
  1. ArthurOct 30, 2012
  2. ArthurOct 31, 2012
  3. Thomas BergOct 31, 2012
  4. Pete WyckoffNov 3, 2012
  5. ArthurNov 5, 2012
  6. Pete WyckoffNov 5, 2012
  7. Vitor AntunesNov 6, 2012
  8. ArthurNov 6, 2012
  9. Vitor AntunesNov 6, 2012
  10. ArthurNov 6, 2012
  11. Vitor AntunesNov 6, 2012
  12. ArthurNov 6, 2012
  13. Pete WyckoffNov 3, 2012
  14. git p4: catch p4 describe errorsPete Wyckoff, Nov 3, 2012
  15. Matt ArsenaultNov 3, 2012

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.