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

Re: git-p4

From
Tor Arvid Lund <torarvid@gmail.com>
Date
Sep 13, 2010, 21:58 UTC
Message-ID
<AANLkTingvEFDygkKipBXfCHJr2=oMQrYv3FKpxpo+TkW@mail.gmail.com>
In-Reply-To
<4C8E511F.8000400@borg.org>
On Mon, Sep 13, 2010 at 6:28 PM, Kent Borg <kentborg@borg.org> wrote:
Show 10 quoted lines
> Tor Arvid Lund wrote:
>> git remote, shows remotes as defined in your .git/config file (the
>> [remote "someremotename"] sections). git-p4 does not need nor create
>> such entries.
>
> I am confused trying to understand what kind of beast the p4/master is.
>
> I think my fundamental problem is that I need p4/master to point at a
> branch with a real git history, not a sync from Perforce (which has no
> git history).
Well, then I think you are a bit confused ;)

The p4/master branch is git's view of your p4 history. So p4/master points to the most recent git/perforce commit. An important side point here, is that if you have another remote (which you do in your case) that is a pure git remote that knows nothing about p4, then the p4/master branch and the origin/master branch will be disjoint.

> How do I change where p4/master points?  (Put another way, how can I
> have a complete Linux history in git but only new work in Perforce?)

Ehm, thinking about this some more, I wonder if this whole endeavor might be continually painful...

Say that you clone Linus' kernel tree with git, and that commit X is the master where you will start your work.

You then import your tree at commit X into p4, and sync it back using git-p4. That git-p4 sync will give you a commit X' - Such that checking out X or X' will yield the same checkout tree, but they will have differing commit IDs... Do you have a strategy if you:

1) Commit something, Y', on top of X' in git (and syncs with p4).
2) Someone else commits Z on top of X, which you get when you do git fetch.

What do you do in p4? You can't be sure that it'll work to apply Z on top of Y', nor the other way around...

It kind of seems like you want to have two different repositories, and you want these to be equal (no one is the "one true repository"), and this presents problems in the scenario I described above, right?

I think maybe draw a few branch trees for git and p4/git-p4 and your own work on a good old piece of paper... It often helps to clear the head and think freshly (is that a word?).

-Tor Arvid-
Previous: Kent BorgNext: Kent Borg
Message 12 of 14 in “Re: git-p4”
  1. Alejandro Riveira FernándezSep 10, 2010
  2. Tor Arvid LundSep 11, 2010
  3. Kent BorgSep 12, 2010
  4. Tor Arvid LundSep 12, 2010
  5. Kent BorgSep 12, 2010
  6. Tor Arvid LundSep 12, 2010
  7. Kent BorgSep 12, 2010
  8. Tor Arvid LundSep 12, 2010
  9. Kent BorgSep 13, 2010
  10. Tor Arvid LundSep 13, 2010
  11. Kent BorgSep 13, 2010
  12. Tor Arvid LundSep 13, 2010
  13. Kent BorgSep 16, 2010
  14. Tor Arvid LundSep 16, 2010

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.