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

Possible bug in git-svn

From
MEMartin Eisenhardt <list-receive@mneisen.org>
Date
May 12, 2007, 16:24 UTC
Message-ID
<200705121824.14190.list-receive@mneisen.org>

Hello Eric, hello list,

I came across what might just possibly be a bug in git-svn. My apologies if this was already handled somewhere on the list but I was not able to find this exact problem mentioned before.

Let's say I run a SVN repository at svn+ssh://svn@example.com/repos and have 
it set up as described at
	
http://svnbook.red-bean.com/nightly/en/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.sshtricks

In essence, there is only one user "svn" with access to the repository, and every developer has his/her public key in ~svn/.ssh/authorized_keys with a line like

command="svnserve -t --tunnel-user=harry -r /svn/" TYPE1 KEY1 harry@example.com

This is desirable to limit the developers access to the repository; no shell, access restricted to svn's home directory.

Now let's assume that within this repository, there are several projects, so we have f.e. the following structure:

+-proj1-+-trunk
|       +-branches
|       +-tags
|
+-proj2-+-trunk
|       +-branches
|       +-tags
+-[more projects]
I have no problem setting up a local .git tracking such a project using
    $ git-svn init svn+ssh://svn@example.com/repos/proj1/trunk
    $ git-svn fetch

After having made local changes and commited them to git, I want to push them to the remote subversion repository:

    $ # do some work
    $ git-commit -a
    $ git-svn dcommit
The last command gives me (invariably):
    Couldn't find a repository: No repository found 
in 'svn+ssh://example.com/repos/proj1/trunk' at at /home/mneisen/bin/git-svn 
line 403

What is odd is that git-svn uses the URL-prefix svn+ssh://example.com/[...] instead of the correct svn+ssh://svn@example.com/[...], i.e., git-svn drops the user name.

This behavior is surprisingly inconsistent as git-svn uses the correct user name while fetching and stores it correctly in .git/config.

The server log contains the following lines:

May 12 18:18:50 [sshd] Accepted keyboard-interactive/pam for mneisen from 217.229.32.249 port 37685 ssh2 May 12 18:18:50 [sshd(pam_unix)] session opened for user mneisen by (uid=0) May 12 18:18:51 [sshd(pam_unix)] session closed for user mneisen

which supports my suspicion that git-svn drops the user name for dcommit and uses the current account name instead.

A git repository on the same machine as the subversion repository is able to track the SVN repository, so it seems that my problems are directly related to the combination of git-svn and the svn+ssh transport of subversion.

If this an error on my part, please advise me how to solve it.

Kind regards Martin Eisenhardt

Next: Eric Wong
Message 1 of 4 in “Possible bug in git-svn”
  1. Martin EisenhardtMay 12, 2007
  2. Eric WongMay 12, 2007
  3. git-svn: don't drop the username from URLs when dcommit is runEric Wong, May 13, 2007
  4. Martin EisenhardtMay 13, 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.