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

Re: git-svn set-tree bug

From
JTJoakim Tjernlund <joakim.tjernlund@transmode.se>
Date
Jun 12, 2007, 09:21 UTC
Message-ID
<1181640065.30670.200.camel@gentoo-jocke.transmode.se>
In-Reply-To
<20070612083910.GA28369@muzzle>
On Tue, 2007-06-12 at 01:39 -0700, Eric Wong wrote:
Show 42 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote:
> > Eric Wong <normalperson@yhbt.net> writes:
> > 
> > > 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
> > 
> > I am not sure what you mean by "mainline", but I assume that you
> > mean "SVN is the main and we are tracking it while taking
> > advantage of more efficient and merge-capable git in guerrilla
> > fashion".  Because the tip of the current branch is what the
> > user is pushing back to SVN via dcommit, I would say it is safe
> > to assume that the first parent of such a merge is the line that
> > corresponds to the SVN branch you are keeping track.
> 
> Yes, "mainline" meaning the history that would be committed to SVN if
> history were linear.
> 
> I've gotten the following patch working for Joakim's second test script
> (with dcommit before merge).  However, without the dcommit before merge
> in the first test script, git-svn has trouble figuring out which history
> to follow.  It'll take more work to figure out what to do in this
> situation, and how to deal with more complex history...
> 
> Subject: git-svn: Allow dcommit to handle certain single-parent merge commits
> 
> This only works if a merge is the first commit to be committed
> in a chain of commits.
[SNIP patch]
Nice!, now I get to keep the merge between the "svn" and the "merge" branch. The parents are swapped though:
before last dcommit:
  Parent: b31cef1d3c6655441854ea8649359f0fc27f3e87 (friend)
  Parent: ed95b698c2e3336d387fed3763b213b3b90ebf4e (add some stuff)
  Branch: svn
  Follows: 
  Precedes: 
    Merge branch 'merge' into svn
after dcommit:
Parent: ed95b698c2e3336d387fed3763b213b3b90ebf4e (add some stuff)
Parent: b31cef1d3c6655441854ea8649359f0fc27f3e87 (friend)
Branches: svn, remotes/trunk
Follows: 
Precedes: 
    Merge branch 'merge' into svn
    
    
    git-svn-id: file:////usr/local/src/tst-git-svn/mysvnrepo/trunk@3 1585b9b0-b13 ....
Will this also work for merging stuff from latest u-boot?

I am doing dev. on my own u-boot branch and from time to time I want to merge in the latest from WD tree, then dcommit that merge. Later I want repeat that cycle.

I have a SVN repo with my changes in it and I have grafted the beginning of that tree into a clone of WDs tree.

 Jocke
Previous: Eric WongNext: Steven Grimm
Message 14 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.