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

Re: git-svn set-tree bug

From
LHLars Hjemli <lh@elementstorage.no>
Date
Jun 12, 2007, 08:04 UTC
Message-ID
<8c5c35580706120104m7c3e2b2cifca513f2dda50d23@mail.gmail.com>
In-Reply-To
<20070612072035.GA29385@muzzle>
On 6/12/07, Eric Wong <normalperson@yhbt.net> wrote:
Show 30 quoted lines
> If dcommit detects a merge commit when doing rev-list When looking at
> commit objects, is it safe to assume that the first parent is always the
> "mainline" and that parents after it are the ones to merge from?
>
> So if I saw:
>
> commit $X
> parent $A
> parent $B
>
> I'd basically do:
>   reset --hard $A
>   merge --squash $B
>
> And resulting in $C which would have the same tree as $X,
> then, when dcommit-ting, $D would be created with two parents:
>   $D~1 (svn), $B (git), but not $A
>
> Rewritten history:
>   $A         =>  $D~1
>   $X         =>  $D (HEAD revision in SVN)
>
> $X and $A are now discarded and gc-able.
>
>
> Of course, since I already have the result of "merge --squash $B" in $X,
> I could just rewrite $X with a single parent (call it $X'), dcommit, and
> then give $D ($D~1 and $B) as parents.  Avoiding the nastiness of
> set-tree
>

Would it be possible to keep the 'local commit' $X and change the mapping in .rev_db to point at $X instead of $D? This would of course require a matching TREE-ID + noMetadata=1. I've been tempted to try to implement this, but my perl-skills are sadly non-existent.

If this is possible it would make my day-job interaction with svn a much more pleasant experience: push/pull between git repos would 'just work' (without -f).

And if "follow left parent" also works out, I (and our 'releasemaster') can finally do all merging in git (without --squash) and preserve the DAG. Ahh, that would be great...

-- larsh

Previous: Joakim TjernlundNext: Steven Grimm
Message 25 of 27 in “git-svn set-tree bug”
  1. Joakim TjernlundJun 8, 2007
  2. Eric WongJun 10, 2007
  3. Joakim TjernlundJun 10, 2007
  4. Joakim TjernlundJun 10, 2007
  5. Eric WongJun 10, 2007
  6. Joakim TjernlundJun 10, 2007
  7. Steven GrimmJun 10, 2007
  8. Joakim TjernlundJun 10, 2007
  9. Eric WongJun 11, 2007
  10. Junio C HamanoJun 11, 2007
  11. Eric WongJun 12, 2007
  12. Junio C HamanoJun 12, 2007
  13. Eric WongJun 12, 2007
  14. Joakim TjernlundJun 12, 2007
  15. Steven GrimmJun 12, 2007
  16. git-svn: allow dcommit to retain local merge informationEric Wong, Jun 13, 2007
  17. Joakim TjernlundJun 13, 2007
  18. Joakim TjernlundJun 13, 2007
  19. Eric WongJun 20, 2007
  20. Eric WongJun 20, 2007
  21. Joakim TjernlundJun 21, 2007
  22. Joakim TjernlundJul 1, 2007
  23. Steven GrimmJun 14, 2007
  24. Joakim TjernlundJun 22, 2007
  25. Lars HjemliJun 12, 2007
  26. Steven GrimmJun 11, 2007
  27. Joakim TjernlundJun 11, 2007

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.