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 12, 2010, 19:54 UTC
Message-ID
<AANLkTi=NGsY3wDiTLwNLpw4TJMpiSY8A=az_=v2fYDLj@mail.gmail.com>
In-Reply-To
<4C8D14F9.90705@borg.org>
2010/9/12 Kent Borg <kentborg@borg.org>:
Show 33 quoted lines
> Tor Arvid Lund wrote:
>> Ok, so if you call this on the cmd line, it should output sha1's on
>> all commits that will be submitted (in reverse order) to p4. If it
>> doesn't, this may well be a good place to dig for a solution.
>
> It does output the commits it wants to submit.  In my broken case far
> too many.
>
> I created a simple working case to see what working looks like, and the
> exact same command outputs just the one commit.  Looking more carefully
> at my gitg pictures in the good and bad cases, I realize that I in the
> broken case I probably don't have the graph I need.
>
>
> Good case:
>
>  (master)
>   |
>  (p4/HEAD)  (p4/master)
>   |
>  initial test import from existing depot
>
>
> Bad case:
>
>  (master)   trivial change I am trying to submit
>   |
>  (tmp)  commit with the "[git-p4: depot-paths = "//depot/[...blah
> blah...]": change  = 160991]" string at the end of the description
>   |
>  Merge remote branch 'p4/master'
>   | \
>   |  (p4/HEAD)  (p4/master)  a commit that is real work
<snip>

Hmm.. Let's define a "commit that contains that [git-p4: depot-paths=...] stuff" as a git/perforce commit. Then I would say that p4/master should always point to the most recent git/perforce commit. In your "Bad case", it seems that it doesn't do that, because the most recent git/perforce commit is (tmp).

When messing about with git-p4 I have sometimes messed up that p4/master ref myself. I can normally fix it by setting it manually: In git, all existing branches are simply files with a sha1 in them (or symbolic refs that point to other refs, like "ref: refs/heads/master"). You should thus be able to put the sha1 of your (tmp) commit into refs/remotes/p4/master.

You could try that and see if git rev-list gives the expected result.
Show 7 quoted lines
> I think my understanding of merges and rebases needs more depth...and I
> think I have mangled branches.
>
>
> I tried a checkout of master and a "git rebase remotes/p4/master" and
> that produced thousands of conflicts.  Was that due to my initial Linux
> sources put in on the Perforce side?

Well, when you do that, git will look back until it finds a common ancestor commit of master and p4/master. I am guessing, that a common ancestor for those branches does not exist in your case... If my guess is correct, git will go back to the beginning of master (to linux 2.6.12-rc2) and try to apply each of those commits on top of p4/master. Naturally, that will cause a world of pain and conflicts ;)

-Tor Arvid-
Previous: Kent BorgNext: Kent Borg
Message 6 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.