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

Re: svn repository URL and git

From
Mathias Lafeldt <misfire@debugon.org>
Date
Oct 27, 2010, 15:31 UTC
Message-ID
<4CC845EE.5040602@debugon.org>
In-Reply-To
<loom.20101027T170254-268@post.gmane.org>
H Krishnan wrote:
Show 21 quoted lines
> Hi, 
> We have started using git and git-svn. 
> I was thrilled to see that two people cloning using "git svn clone" 
> from the same repository got the same sha1 IDs for the commits which 
> meant that each of us could sync with svn independently while still 
> being able to share code among ourselves. 
> But my excitement was shortlived as the sha1 IDs were different if we 
> refer to the svn server using an alias. For example, using 
> http://mysvnserver.mydomain.com/repos/myproject/trunk gave different 
> sha1 IDs from using http://mysvnserver/repos/myproject/trunk even 
> though both refer to the same repository. This also disallowed using 
> mirrors of the repository for cloning. 
> Apparently the sha1 ID is generated from the full path of the URL. 
> Instead of this, could git-svn init be made to accept an optional 
> "prefix" argument as well which is filtered out of the URL before 
> building the sha1 ID. This will allow easy support for the oft 
> requested support for "svn switch --relocate". How much of an effort 
> is this? I don't know perl or git internals well enough for me to take 
> a stab at it but I am willing to learn if someone can give me some 
> pointers. 
> Krishnan

The problem is the "git-svn-id" which is automatically appended to each commit done with git-svn. This ID consists of the URL and the UUID of the corresponding SVN repository. A different git-svn-id value results in a different commit SHA1 (i.e. a different commit to git).

I guess git-svn's --rewrite-root option might help here. Also, you have to make sure that your SVN repos have the same UUID (with svnadmin setuuid), of course.

-Mathias
Previous: H KrishnanNext: H Krishnan
Message 2 of 8 in “svn repository URL and git”
  1. H KrishnanOct 27, 2010
  2. Mathias LafeldtOct 27, 2010
  3. H KrishnanOct 27, 2010
  4. H KrishnanOct 28, 2010
  5. Ulrich SpörleinOct 28, 2010
  6. Mathias LafeldtOct 28, 2010
  7. Ulrich SpörleinOct 28, 2010
  8. H KrishnanOct 29, 2010

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.