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

Re: git-p4: Clone p4 path with bidirectional integrations

From
Luke Diamand <luke@diamand.org>
Date
Aug 19, 2019, 20:23 UTC
Message-ID
<CAE5ih78UOor3XT_hDofanoGUPLD1BC2y=pCbzF-Edm2mpRvjyQ@mail.gmail.com>
In-Reply-To
<CALSvhyb7Td-ugzze9cSLXRjF78w=zE5=3yuMFZVeuXsCWLSjHg@mail.gmail.com>
On Mon, 19 Aug 2019 at 18:30, Aaron Miller <aaronkmiller@gmail.com> wrote:
Show 9 quoted lines
>
> Hi all,
>
> Is it possible to `git p4 clone --detect-branches` from a Perforce
> path which contains bidirectional integrations?
>
> I've tried a bunch of things to get this to work, but here's an
> example which hopefully illustrates what I'm trying to accomplish
> and the issue I'm having.
I have to admit I don't use the detect-branches code myself.
It's possible that running with "-v" might give a bit more information.

Can you write a test case, or even just a shell script, that might help figure out what's going on.

Unfortunately Perforce doesn't really know about branches, so git-p4 has to make a guess!

Show 37 quoted lines
>
> Perforce setup, assuming PWD is mapped to //depot/... in your client spec:
>
>   1. mkdir -p testing/master
>   2. touch testing/master/test1 && p4 add testing/master/test1 && p4 submit
>   3. p4 integrate //depot/testing/master/...
> //depot/testing/staging/... && p4 submit
>   3. touch testing/staging/test2 && p4 add testing/staging/test2 && p4 submit
>   4. p4 integrate //depot/testing/staging/...
> //depot/testing/master/... && p4 submit
>
> Now try to clone with git-p4:
>
>   1. git init p4_git_test && cd p4_git_test
>   2. git config git-p4.branchList master:staging
>   3. git config --add git-p4.branchList staging:master
>   4. git p4 clone //depot/testing/...@all --detect-branches .
>
> You end up with a failure like:
>
>   Importing from //depot/testing/...@all into .
>   Reinitialized existing Git repository in /home/amiller/p4_git_test/.git/
>   Importing revision 1205832 (25%)
>       Importing new branch testing/master
>
>       Resuming with change 1205832
>   fatal: ambiguous argument 'refs/remotes/p4/testing/staging': unknown
> revision or path not in the working tree.
>   Use '--' to separate paths from revisions, like this:
>   'git <command> [<revision>...] -- [<file>...]'
>   Command failed: ['git', 'rev-list', '--reverse', '--no-merges',
> 'refs/remotes/p4/testing/staging']
>
> I'm using Git 2.22.1.
>
> Thanks,
> Aaron
Previous: Aaron MillerNext: Aaron Miller
Message 2 of 6 in “git-p4: Clone p4 path with bidirectional integrations”
  1. Aaron MillerAug 19, 2019
  2. Luke DiamandAug 19, 2019
  3. Aaron MillerAug 20, 2019
  4. AndreyAug 20, 2019
  5. Aaron MillerAug 20, 2019
  6. AndreyAug 23, 2019

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.