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

Re: [RFC] Using git-p4 on project with branches

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Aug 18, 2008, 21:44 UTC
Message-ID
<alpine.LNX.1.00.0808181732180.19665@iabervon.org>
In-Reply-To
<1a6be5fa0808180226h79eebf46yad9174b1518d4eed@mail.gmail.com>
On Mon, 18 Aug 2008, Tor Arvid Lund wrote:
Show 26 quoted lines
> Hi!
> 
> I really appreciate the work that is done with allowing us poor souls
> stuck with perforce at work to use git via git-p4. But I'm wondering
> how to make it work when there are several branches on the perforce
> server.
> 
> Say, for instance, that I have this setup:
> 
> //depot/old/path/to/projectX
> //depot/new/path/to/projectX_Devel_Branch
> //depot/new/path/to/projectX_Release_1.2_Branch
> //depot/new/path/to/projectOther
> 
> It would be really nice, if I were able to make a projectX.git
> repository with the 'old', 'devel' and '1.2' branches. It seems that
> the --detect-branches argument to P4Sync wants me to enter
> //depot/new/path/to as the root path, and detect p4 branchspecs from
> there. That works poorly for me, since it would also include
> projectOther, which I don't want. It would also not include the 'old'
> branch.
> 
> I have looked briefly at the git-p4 code, but don't know it very well
> yet. Anyway, I suspect this functionality is not implemented... I
> might try to do this myself, and if anybody has ideas on how to get
> started, it would be much appreciated.

You might want to also look at git-p4raw, which does extremely clever branch tracking, but acts on the perforce server database directly. If you figured out how to supply its engine with information through the client, it would be really great (but likely slow on the order of "leave it importing over the weekend").

Show 8 quoted lines
> To support submitting changelists back to perforce, it would probably
> need some configuration (to determine which path to submit to in
> perforce)... Like:
> 
> [git-p4 "branches"]
>         old = //depot/old/path/to/projectX
>         devel = //depot/new/path/to/projectX_Devel_Branch
>         1.2 = //depot/new/path/to/projectX_Release_1.2_Branch

You'd get "master = //depot/new/path/to/projectX_Devel_Branch", probably, by default, and then could add "old" and "1.2".

> Well, I guess I'm just wondering if this is something anybody but me
> would like to have? Or if there is another/better way to go about
> doing it...
I'd certainly like it. (But it's likely to be really tricky.)
	-Daniel
*This .sig left intentionally blank*
Previous: Tor Arvid LundNext: Simon Hausmann
Message 2 of 3 in “[RFC] Using git-p4 on project with branches”
  1. Tor Arvid LundAug 18, 2008
  2. Daniel BarkalowAug 18, 2008
  3. Simon HausmannAug 24, 2008

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.