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

Re: git svn info --url lacks username

From
Geert Uytterhoeven <geert@linux-m68k.org>
Date
May 17, 2011, 16:51 UTC
Message-ID
<BANLkTik1n8SCVu1-EwVrhJ7rURtk16eA9A@mail.gmail.com>
In-Reply-To
<BANLkTinCx4pEycjGmWA=jZ8os7R3tZWXNQ@mail.gmail.com>
On Thu, May 12, 2011 at 14:13, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
Show 13 quoted lines
> I'm using git-svn. Due to local policies and for compatibility with the other
> developers using plain svn, I have to lock a file before committing anything to
> the svn repository.
>
> Hence I wrote a small wrapper script around "git svn dcommit", which basically
> does:
>
> | SVNROOT=$( ( cd ./$(git rev-parse --show-cdup) && git svn info --url ) )
> | SVNLOCKFILE=$SVNROOT/lockfile
> |
> | svn lock $SVNLOCKFILE
> | git svn dcommit $*
> | svn unlock $SVNLOCKFILE
[...]
Show 11 quoted lines
> My .git/config has
>
> | [svn-remote "svn"]
> |         url = svn+ssh://user@server/project
>
> But "git svn info --url" only prints:
>
> | svn+ssh://server/project/sub/branches/branch
>
> i.e. the username part is missing.
> Obviously "git svn dcommit" does use the correct URL.
[...]
Show 5 quoted lines
> I tried, "git config --get svn-remote.svn.url", but that only gives me
> "svn+ssh://user@server/project", i.e. it lacks the "/sub/branches/branch" part.
>
> Do you have any idea what's going on, or how to fix it?
> Shouldn't "git svn info --url" include the username?
I ended up adding:
| SVNURL=$(git config --get svn-remote.svn.url)
| case $SVNURL in svn+ssh://*@*)
|         SVNROOT=${SVNURL%%@*}@${SVNROOT#svn+ssh://}
|         ;;
| esac

so it hacks in the username from the config file. But I don't think that's the ideal solution?

Gr{oetje,eeting}s,
                        Geert

-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Previous: Geert Uytterhoeven
Message 2 of 2 in “git svn info --url lacks username”
  1. Geert UytterhoevenMay 12, 2011
  2. Geert UytterhoevenMay 17, 2011

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.