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

Re: git p4: any way to avoid rebasing all the time?

From
Vitor Antunes <vitor.hda@gmail.com>
Date
Apr 11, 2012, 17:22 UTC
Message-ID
<CAOpHH-Ufa7m8rEe+CTEGo-ChLOfFgyBkeiWrP92Sv=VLKgVmZA@mail.gmail.com>
In-Reply-To
<CAE5ih7_Fh0XA-XNNvtHnXhYwUvwmmg-Z+y-Mb5Wvra3Y83eFsw@mail.gmail.com>
On Wed, Apr 11, 2012 at 5:27 PM, Luke Diamand <luke@diamand.org> wrote:
Show 33 quoted lines
> Is there a way to get "git p4" to not rebase all the time?
>
> Right now, git commits get discarded and replaced with new ones with
> the same contents and extra git-p4 metadata embedded in the comment.
>
> If we put this git-p4 metadata into a git note then we would not need
> to rewrite the commits, and so could perhaps avoid rebasing quite so
> much.
>
> However, if "git p4" won't rewrite commits, then it can't reorder them
> to match the ordering seen from p4.
>
> So you could end up with git users seeing OLDHEAD,G,P and p4 users
> seeing OLDHEAD,P,G, as there's a race to see who submits against
> OLDHEAD first, which p4 always wins.
>
> Would this matter (assuming the git and p4 commits are all reasonably
> independent) or is there a way to avoid it?
>
> Perhaps hook into the pre-receive hook? If the newest p4 changelist is
> not the same as the HEAD of the branch being pushed to, then reject
> the push, just as would happen if the branch could not be
> fast-forwarded in a normal git repo? (Even with this there is still a
> small window of opportunity).
>
> At that point, the "git p4 rebase" command would still be used, but
> would normally be a no-op.
>
> Or would that result in something far too complicated to have any
> chance of working?
>
> Thanks,
> Luke
Hi Luke,
This guy modified git-p4 to store information in notes:
https://github.com/ermshiperete/git-p4
Could you see if his implementation would fit your requirements?
Vitor
Previous: Luke DiamandNext: Pete Wyckoff
Message 2 of 3 in “git p4: any way to avoid rebasing all the time?”
  1. Luke DiamandApr 11, 2012
  2. Vitor AntunesApr 11, 2012
  3. Pete WyckoffApr 18, 2012

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.