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

Re: [PATCH] A utility to perform merges between Subversion branches using git

From
Junio C Hamano <junkio@cox.net>
Date
Apr 27, 2007, 22:38 UTC
Message-ID
<7v3b2lmoi7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vy7kephg8.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 10 quoted lines
>> +if test "$Status" = "committed"; then
>> +	git svn dcommit || \
>> +		die "Can't commit to Subversion"
>> +
>> +	# dcommit will update our current HEAD to point to the newly committed
>> +	# svn revision. Update grafts file to tell git that it's a merge.
>> +	NewRevision="`git rev-list --max-count=1 HEAD`"
>> +	echo "$NewRevision $OldHead $RevToMerge" >> $GitDir/info/grafts
>
> This graft look very yucky, and would not scale.
Style issues aside...

I do not know what dcommit is supposed to do, but I wonder if that graft part can be folded into it. Even if git-svn cannot deal with merges that happen on the svn side, assuming if your grafting solution works, it indicates that git-svn itself does not have trouble seeing a merge commit on git side, as its invocation of "git-rev-list --parents" would show that the commit you grafted an extra parent to has two parents and git-svn needs to be able to deal with it.

The command sequence in your contrib script is:
 - make a commit on top of git-svn managed head by hand,
   recording what should have happened if git-svn knew how to
   merge two svn branches;
 - make svn dcommit to record it to svn side, and let it make an
   extra commit to mark the synchronization between git-svn
   managed head and svn repository;
 - pretend that the synchronization commit svn dcommit made has
   an extra commit, which is what you created by hand;

So perhaps you can add an option "git-svn dcommit --merge $OldHead $RevToMerge" that does whatever it usually does and record the resulting commit as a merge between these two commits?

Previous: Junio C Hamano
Message 3 of 3 in “A utility to perform merges between Subversion branches using git”
  1. A utility to perform merges between Subversion branches using gitSteven Grimm, Apr 27, 2007
  2. Junio C HamanoApr 27, 2007
  3. Junio C HamanoApr 27, 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.