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

Re: Editing git-svn metadata

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
May 4, 2009, 15:39 UTC
Message-ID
<49FF0C2A.6050503@drmicha.warpmail.net>
In-Reply-To
<24ACA1E2-9B33-412D-A426-FAF3CF683ADA@orestis.gr>
Orestis Markou venit, vidit, dixit 02.05.2009 03:02:
Show 24 quoted lines
> Hello,
> 
> I couldn't find anything in the manpages for this, and I don't know  
> where else to look for it.
> 
> As mentioned here: http://article.gmane.org/gmane.comp.version-control.git/116382 
>   , an svn repository I'm working against has a weird layout on which  
> git-svn chokes on. I'm working around that by using grafts to inform  
> git about the history of the branches. It involves some manual work  
> but it's fine.
> 
> Another problem I have (possibly linked) is that branches are only  
> detected after the first commit to them - the commit that creates the  
> branch is not recorded by git-svn at all. This forces me to do a  
> 'dummy' commit from svn in order to even see the branch in git-svn.
> 
> Given that I have all the information I need (branch name, parent id),  
> is there any file I can manually edit to inform git-svn about my  
> branches?
> 
> Alternatively, and more usefully to git in general, perhaps I can have  
> a look at the git-svn code and add some diagnostics to see what's  
> failing, and provide a patch? I looked for a developer guide but  
> couldn't find one (only how to write tests).

It may depend on how you create branches in svn. The usual way is to copy from trunk (or another branch) in the way the attached script does. For me, the relevant output is

* master
  remotes/mybranch
  remotes/trunk

which is pretty much what it should be. Do you create (empty) branches by doing a mkdir in an svn check out of the base dir (below trunk)?

Michael
--- %< ---
#!/bin/bash
rm -Rf svnrepo svnwc gitrepo
svnurl="file://localhost"`pwd`/svnrepo
svnadmin create svnrepo
svn co $svnurl svnwc
(
 cd svnwc
 mkdir trunk branches tags
 svn add trunk branches tags
 svn ci -m init
 (
  cd trunk
  echo a > a
  svn add a
  svn ci -m A
  svn cp -m mybranch $svnurl/trunk $svnurl/branches/mybranch
 )
)
git svn clone -s $svnurl gitrepo
(
 cd gitrepo
 git branch -a
)
Previous: Orestis Markou
Message 2 of 2 in “Editing git-svn metadata”
  1. Orestis MarkouMay 2, 2009
  2. Michael J GruberMay 4, 2009

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.