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

Re: git-svn: Finding the svn-URL of the current branch in git

From
PBPeter Baumann <waste.manager@gmx.de>
Date
Aug 8, 2007, 19:25 UTC
Message-ID
<20070808192537.GB27470@xp.machine.xx>
In-Reply-To
<f9d3ce$1lo$1@sea.gmane.org>
On Wed, Aug 08, 2007 at 08:51:55PM +0200, Matthias Kleine wrote:
Show 9 quoted lines
> Junio C Hamano wrote:
>> Parents' order and which branch you are on may not have anything
>> to do with each other.  Somebody else may have pulled a while on
>> b, and you might have pulled from him the merge he created by
>> doing so while you are on branch a.
>
> You're right, I didn't think of that. While pondering this I came up with
> another problem: git-svn currently remembers which svn-branch a commit
> belongs to by including this information in the git commit log message.
Thats true.
> This way it is not possible to have one git-commit appear in more than one
> svn branch.

But there is no way that a git commit could appear on several branches in SVN, because SVN doesn't have the concept of multiple parents. So you can't have a commit which describes a merge of two branches, because SVN can't store the 2 parents. But you could have 2 commits which describe the same state (e.g. same root tree), but are on seperate branches.

t:= commits on trunk b:= commits on branch 'b'

repo1:
	t    <-trunk
	|
	t
	| \
	t  b <- branch
	| /
	t

But this graph is only local to the committers repo. Another person using git-svn to track the SVN repo sees this

repo2/SVN repo:
	t     <-trunk
	|
	t
	|
	t  b  <- branch
	| /
	t

So if you do a 'git merge trunk' in repo1 on branch 'branch', git-svn should produce something like this:

repo2/SVN repo:
trunk->	t  t' <- branch
	|  |
	t  t'
	|  |
	t  b
	| /
	t

The interesting case is what it will produce in *YOUR* repo. There are 2 possibilities:

repo1 (I):				repo1 (II)
	tb   <-trunk <-branch		trunk->	t  b <- branch
	|					|  |
	tb					t  b
	| \					| \|
	t  b <- branch				t  b
	| /					| /
	t					t
(I)  would be nicer, but propably more difficult the way git-svn works now.
(II) would also be possible and more in line what other people importing
     from SVN see.
These are the possible ways to describe the merge of 2 SVN branches.
-Peter
Previous: Matthias KleineNext: Peter Baumann
Message 6 of 15 in “git-svn: Finding the svn-URL of the current branch in git”
  1. Matthias KleineAug 7, 2007
  2. Peter BaumannAug 7, 2007
  3. Matthias KleineAug 8, 2007
  4. Junio C HamanoAug 8, 2007
  5. Matthias KleineAug 8, 2007
  6. Peter BaumannAug 8, 2007
  7. Peter BaumannAug 8, 2007
  8. Eric WongAug 16, 2007
  9. Peter BaumannAug 16, 2007
  10. Eric WongAug 17, 2007
  11. Junio C HamanoAug 17, 2007
  12. Eric WongAug 18, 2007
  13. David KastrupAug 18, 2007
  14. Junio C HamanoAug 18, 2007
  15. Karl HasselströmAug 18, 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.