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

Re: git-svn: Fetch svn branches only and have git recognize them as branches?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2015, 23:13 UTC
Message-ID
<xmqq385924j3.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAMMCKnc9AKjuwQ_RNxD_g3tn=xFQkbO1i-U=rP2VLWPi7qizGA@mail.gmail.com>
Brian Koehmstedt <bkoehmstedt@berkeley.edu> writes:
Show 7 quoted lines
> I'm trying deal with a project where the server is disallowing access to
> the root URL on the subversion server.
>
> i.e.,
> Doesn't allow access: http://abc.com/repo
> Does allow access: http://abc.com/repo/trunk, http://abc.com/repo/branches,
> http://abc.com/repo/tags
[warning: I have never used 'git svn' myself for several years]

The problem sounds like what this commit (which is v1.5.1.5~15) fixed:

commit 4a1bb4c3f87f355dd52fcd0babcbd005d59d7ed6
Author: Eric Wong <normalperson@yhbt.net>
Date:   Sun May 13 09:58:14 2007 -0700
    git-svn: don't attempt to minimize URLs by default
    
    For tracking branches and tags, git-svn prefers to connect
    to the root of the repository or at least the level that
    houses branches and tags as well as trunk.  However, users
    that are accustomed to tracking a single directory have
    no use for this feature.
    
    As pointed out by Junio, users may not have permissions to
    connect to connect to a higher-level path in the repository.
    
    While the current minimize_url() function detects lack of
    permissions to certain paths _after_ successful logins, it
    cannot effectively determine if it is trying to access a
    login-only portion of a repo when the user expects to
    connect to a part where anonymous access is allowed.
    
    For people used to the git-svnimport switches of
    --trunk, --tags, --branches, they'll already pass the
    repository root (or root+subdirectory), so minimize URL
    isn't of too much use to them, either.
    
    For people *not* used to git-svnimport, git-svn also
    supports:
    
     git svn init --minimize-url \
      --trunk http://repository-root/foo/trunk \
      --branches http://repository-root/foo/branches \
      --tags http://repository-root/foo/tags
    
    And this is where the new --minimize-url command-line switch
    comes in to allow for this behavior to continue working.

The description of the commit makes me think that mimicking the sample command line without minimize-url ought to work, i.e.

    git svn init \
        --trunk    http://abc.com/repo/trunk \
        --branches http://abc.com/repo/branches \
        --tags     http://abc.com/repo/tags

But I've never used 'git svn' for several years, so I may be completely off the mark.

Previous: Brian KoehmstedtNext: Brian Koehmstedt
Message 2 of 5 in “git-svn: Fetch svn branches only and have git recognize them as branches?”
  1. Brian KoehmstedtMar 12, 2015
  2. Junio C HamanoMar 12, 2015
  3. Brian KoehmstedtMar 12, 2015
  4. Brian KoehmstedtMar 16, 2015
  5. Eric WongMar 12, 2015

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.