threads / discuss / 28894

Problem with git-svn with limited SVN access

Subject: Problem with git-svn with limited SVN access

## tl;dr

3 messages between Nov 9, 2011 and Nov 10, 2011.

replies: 2people: 2as markdown or json

Antoine Bonavita· Nov 9, 2011, 11:28 UTC · lore
Hello,

I have a problem with a git-svn setup and although I spent most of yesterday googling for a solution but did not find any (see below for my failed attempts). I hope you guys here will be able to help me.

I have limited access to a SVN repository with a "standard" layout. By limited, I mean that I am allowed only to access the folders "trunk", "branches/XXX" and "branches/YYY".

*Attempt 1:*
 > git svn init svn://server/aaa/AAA -T trunk -b branches --username=UUU
Initialized empty Git repository in /home/.../.git/
Using higher level of URL: svn://server/aaa/AAA => svn://server/aaa
 > git svn fetch
Error from SVN, (220001): Item is not readable: Item is not readable
*Attempt 2:*
 > git svn init svn://server/aaa/AAA -T trunk -b branches --username=UUU 
--no-minimize-url
Initialized empty Git repository in /home/.../.git/
 > git svn fetch
W: Item is not readable: Item is not readable at 
/usr/libexec/git-core/git-svn line 1782
Error from SVN, (220001): Item is not readable: Item is not readable
*Attempt 3:*
 > git svn init svn://server/aaa/AAA -T trunk --username=UUU 
--no-minimize-url
Initialized empty Git repository in /home/.../.git/
 > git svn fetch
W: Item is not readable: Item is not readable at 
/usr/libexec/git-core/git-svn line 1782
W: Ignoring error from SVN, path probably does not exist: (160013): 
Filesystem has no item: File not found: revision 100, path '/AAA/trunk'
W: Do not be alarmed at the above message git-svn is just searching 
aggressively for old history.
This may take a while on large repositories
Read access denied for root of edit: Not authorized to open root of edit 
operation at /usr/libexec/git-core/git-svn line 5131
*Attempt 4:*
 > git svn init -T svn://server/aaa/AAA/trunk -b 
svn://server/aaa/AAA/branches --username=UUU --no-minimize-url
Initialized empty Git repository in /home/.../.git/
svn-remote.svn.url already set: svn://server/aaa/AAA/trunk
wanted to set to: svn://server/aaa/AAA/branches
 > git svn fetch
W: Ignoring error from SVN, path probably does not exist: (160013): 
Filesystem has no item: File not found: revision 100, path '/AAA/trunk'
W: Do not be alarmed at the above message git-svn is just searching 
aggressively for old history.
This may take a while on large repositories
          ### stuff actually retrieved from SVN
          .....
r6035 = 6163cb28acff14d68f1b96869274b668405897a2 (refs/remotes/trunk)
          .....
Compressing objects: 100% (10751/10751), done.
Writing objects: 100% (10886/10886), done.
Total 10886 (delta 9331), reused 0 (delta 0)
Checking out files: 100% (6002/6002), done.
Checked out HEAD:
   svn://server/aaa/AAA/trunk r27316
creating empty directory: lib/AAA/mp3gain/otherlang/help
...
### No line with any branch. So it looks like I managed to get the trunk 
but not the branches.
*Attempt 5:*
 > git svn init -T svn://server/aaa/AAA/trunk -b 
svn://server/aaa/AAA/branches --username=UUU --no-minimize-url
Initialized empty Git repository in /home/.../.git/
svn-remote.svn.url already set: svn://server/aaa/AAA/trunk
wanted to set to: svn://server/aaa/AAA/branches
### My .git/config looks like:
[svn-remote "svn"]
         url = svn://server/aaa/AAA/trunk
         fetch = :refs/remotes/trunk
### If I try to add one of the branches manually:
branches = branches/XXX:refs/remotes/branches/XXX
 > git svn fetch
One '*' is needed in glob: 'branches/XXX'
*Attempt 6:*
 > git svn init -T svn://server/aaa/AAA/trunk -b 
svn://server/aaa/AAA/branches --username=UUU --no-minimize-url
Initialized empty Git repository in /home/.../.git/
svn-remote.svn.url already set: svn://server/aaa/AAA/trunk
wanted to set to: svn://server/aaa/AAA/branches
### I put a glob instead of the branch name in git/.config:
branches = branches/{XXX,YYY}:refs/remotes/branches/*
 > git svn fetch
...
Counting objects: 10886, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (10751/10751), done.
Writing objects: 100% (10886/10886), done.
Total 10886 (delta 9330), reused 0 (delta 0)
error: Untracked working tree file 'COPYRIGHT.txt' would be overwritten 
by merge.
read-tree -m -u -v HEAD HEAD: command returned error: 128
### Only refs/remotes/trunk checked out. No branch.

At this point, I'm really lost and running out of ideas. If someone could help me with this, I would be very grateful.

Please forgive me if I posted to the wrong mailing-list but I could not find a specific git-svn list. If there is such thing, please point me in the right direction.

Thanks,
Antoine.
-- 
Antoine Bonavita (antoine@stickyadstv.com)
Envoyé de mon PC. Moi je suis Fedora.
Thomas Rast· Nov 9, 2011, 22:38 UTC · re: Antoine Bonavita · lore

Re: Problem with git-svn with limited SVN access

Antoine Bonavita wrote:
> ### If I try to add one of the branches manually:
> branches = branches/XXX:refs/remotes/branches/XXX
>  > git svn fetch
> One '*' is needed in glob: 'branches/XXX'

I think having several fetch specs should do the trick, although I cannot easily test with actual permissions.

You can start configuring the repo with
  git init
  git svn init svn://server/ -T trunk
to get an initial layout.  The .git/config will look like
  [svn-remote "svn"]
          url = svn://server/
          fetch = trunk:refs/remotes/trunk

The clue is that the config says 'fetch', not 'trunk'. Much like with git remotes, you can add more fetch specs along the lines of

          fetch = branches/XXX:refs/remotes/svn/XXX
or whatever layout you prefer.

Please tell us whether that works even in the face of restrictions on branches/ itself :-)

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Antoine Bonavita· Nov 10, 2011, 08:36 UTC · re: Thomas Rast · lore

Re: Problem with git-svn with limited SVN access

Thomas,
Thanks a lot for taking the time to look at my problem.
On 11/09/2011 11:38 PM, Thomas Rast wrote:
Show 26 quoted lines
> Antoine Bonavita wrote:
>> ### If I try to add one of the branches manually:
>> branches = branches/XXX:refs/remotes/branches/XXX
>>   >  git svn fetch
>> One '*' is needed in glob: 'branches/XXX'
>
> I think having several fetch specs should do the trick, although I
> cannot easily test with actual permissions.
>
> You can start configuring the repo with
>
>    git init
>    git svn init svn://server/ -T trunk
>
> to get an initial layout.  The .git/config will look like
>
>    [svn-remote "svn"]
>            url = svn://server/
>            fetch = trunk:refs/remotes/trunk
>
> The clue is that the config says 'fetch', not 'trunk'.  Much like with
> git remotes, you can add more fetch specs along the lines of
>
>            fetch = branches/XXX:refs/remotes/svn/XXX
>
> or whatever layout you prefer.
I did what you suggested. Now my .git/config looks like:
[svn-remote "svn"]
         url = svn://server/aaa/AAA
         fetch = trunk:refs/remotes/trunk
        fetch = branches/XXX:refs/remotes/svn/XXX
  and here is the result:
 > git svn fetch
W: Item is not readable: Item is not readable at 
/usr/libexec/git-core/git-svn line 1782
Error from SVN, (220001): Item is not readable: Item is not readable

Any other idea ? Or is there a way to get more debug info from git-svn. May be it would give us some insight on what it is trying to do and failing to.

Thanks,
Antoine.
>
> Please tell us whether that works even in the face of restrictions on
> branches/ itself :-)
>
-- 
Antoine Bonavita (antoine@stickyadstv.com)
Envoyé de mon PC. Moi je suis Fedora.

← back to recent threads