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

Re: git-svn and a nested branches folder

From
RBRuss Brown <pickscrape@gmail.com>
Date
Sep 4, 2007, 15:21 UTC
Message-ID
<46DD77F2.3040000@gmail.com>
In-Reply-To
<86r6leeaq7.fsf@lola.quinscape.zz>
David Kastrup wrote:
Show 40 quoted lines
> Russ Brown <pickscrape@gmail.com> writes:
> 
>> David Kastrup wrote:
>>> Russ Brown <pickscrape@gmail.com> writes:
>>>
>>>> I'm having some trouble with using git-svn to fetch a repository, and I
>>>> think it's because the repository doesn't store branches as a flat list
>>>> directly under the 'branches' directory.
>>>>
>>>> Basically, we have a structure like this:
>>>>
>>>> |
>>>> +-trunk
>>>> +-tags
>>>> +-branches
>>>>   + category-a
>>>>     + branch-a
>>>>     + branch-b
>>>>   + category-b
>>>>     + branch-c
>>>>     + branch-d
>>>>
>>>> etc. category-a and category-b are simple directories created using svn
>>>> mkdir. The branches are created using svn cp.
>>>>
>>>> It helps us to organise the branches better, but the rationale is
>>>> besides the point. The problem is that git-svn seems to want to
>>>> treat category-a and category-b as branches, which isn't right at
>>>> all. As a result, git-svn seems to skip most (if not all) revisions
>>>> that occur in these directories and creates a lot of entries in
>>>> unhandled.log.
>>> So what did you specify in your .git/config file regarding the svn
>>> structure?
>> I specified the 'branches' directory, but that's because earlier in
>> the life of the repo we did just do the flat branch layout, but
>> decided to make it more structured once that got unwieldy.
> 
> Cough, cough.  _What_ did you specify in your .git/config file
> regarding the svn structure?  Please quote the section.
> 
Erm, sorry.
[svn-remote "svn"]
        url = svn://svn.<name>.com
        fetch = trunk:refs/remotes/trunk
        branches = branches/*:refs/remotes/*
        tags = tags/*:refs/remotes/tags/*
(URL changed in case it annoys my employers)
I didn't write this by hand: it was generated by git-svn init.
Show 13 quoted lines
>> Is it possible to specify more than one folder for the branches
>> option?
> 
> It is possible to adapt the config section to the actual layout.  If
> not otherwise, by starting with
> git svn init
> with a clean slate, editing the config file, and only then actually
> fetching stuff.
> 
> However, git-svn will not magically start guessing that you changed
> your structure around.  You have to edit the configuration
> appropriately.
> 

That's why I suggested that a method involving detecting branches based on whether the directory is a copy of trunk or another branch might 'magically' work in all scenarios. I've used a similar branch 'scanning' technique before for a different reason. But I realise there may be technical reasons as to why that might not be possible.

-- 
Russ
Previous: David KastrupNext: Peter Baumann
Message 5 of 11 in “git-svn and a nested branches folder”
  1. Russ BrownSep 4, 2007
  2. David KastrupSep 4, 2007
  3. Russ BrownSep 4, 2007
  4. David KastrupSep 4, 2007
  5. Russ BrownSep 4, 2007
  6. Peter BaumannSep 4, 2007
  7. Russ BrownSep 4, 2007
  8. Eric WongSep 5, 2007
  9. Russ BrownSep 5, 2007
  10. Eric WongSep 5, 2007
  11. Russ BrownSep 5, 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.