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

Re: [PATCH v3 0/4] git-p4: Improve branch support

From
Vitor Antunes <vitor.hda@gmail.com>
Date
Aug 19, 2011, 14:30 UTC
Message-ID
<CAOpHH-WeLWyEZaktYRzVN+dfgqu3==o4bgrfzpvS-QUCQboPgg@mail.gmail.com>
In-Reply-To
<20110819115310.GC15639@padd.com>
On Fri, Aug 19, 2011 at 12:53 PM, Pete Wyckoff <pw@padd.com> wrote:
Show 6 quoted lines
> Patches 1 and 2 are great.  We should have gotten those in way
> back when you first submitted them.  I happily ack those.
>
> I'm still a bit hung up on #3, mainly because I don't get branch
> support.  Let me play around with your test.  Having this
> playbook of how it is supposed to work will help to educate me.

(I am probably going in too much detail here. Please skip any redundant information.)

In general, you can see branches in P4 as you do in SVN. They are simple copies from one directory to another. For example:

    p4 integrate //depot/big/directory/path/myproj/version_A \
                 //depot/big/directory/path/myproj/version_B

Now the history of "version_B" is tied to "version_A". If you want to integrate (merge, in this case) new updates from one of the directories to the other you can just rerun the above command (version_A and version_B order may change depending on the direction of the merge).

P4 also allows you to define "branch specs" that you can use as a short hand instead of having to type in the full directory paths. So, assuming that you have a branch named "myproj_B" with the following view defined:

    //depot/big/directory/path/myproj/version_A \
        //depot/big/directory/path/myproj/version_B
When you want to integrate it again you can simply type:
    p4 integrate -b myproj_B
or, if you want to integrate from version_B into version_A instead:
    p4 integrate -b myproj_B -r

git-p4 is using these branch specs to identify branches. Without this extra information it is nearly impossible for it to identify branches because an integrate can be done of a single file.

But since P4 does not strictly require branch specs and because most of the time integrations are done through P4V, then most of the time no branch specs are created. Now, if this happens git-p4 will not be able to detect branches! And creating branches in P4 just for git-p4 does not make much sense, right? This is the main reason behind the third patch... :)

Sorry for the long email.
-- 
Vitor Antunes
Previous: Pete WyckoffNext: Pete Wyckoff
Message 8 of 12 in “git-p4: Improve branch support”
  1. 0/4 git-p4: Improve branch supportVitor Antunes, Aug 18, 2011
  2. 1/4 git-p4: Correct branch base depot path detectionVitor Antunes, Aug 18, 2011
  3. 2/4 git-p4: Allow filtering Perforce branches by userVitor Antunes, Aug 18, 2011
  4. 3/4 git-p4: Allow branch definition with git configVitor Antunes, Aug 18, 2011
  5. 4/4 git-p4: Add simple test case for branch importVitor Antunes, Aug 18, 2011
  6. Pete WyckoffAug 20, 2011
  7. Pete WyckoffAug 19, 2011
  8. Vitor AntunesAug 19, 2011
  9. Pete WyckoffAug 20, 2011
  10. Vitor AntunesAug 23, 2011
  11. Junio C HamanoAug 19, 2011
  12. Vitor AntunesAug 19, 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.