{"thread":{"id":"27337","subject":"git svn info --url lacks username","startedAt":"2011-05-12T12:13:45Z","lastAt":"2011-05-17T16:51:56Z","messageCount":2,"participants":["Geert Uytterhoeven"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"167727","messageId":"BANLkTinCx4pEycjGmWA=jZ8os7R3tZWXNQ@mail.gmail.com","threadId":"27337","inReplyTo":null,"subject":"git svn info --url lacks username","fromName":"Geert Uytterhoeven","fromEmail":"geert@linux-m68k.org","sentAt":"2011-05-12T12:13:45Z","receivedAt":"2011-05-12T12:13:45Z","isPatch":false,"sender":{"key":"geert@linux-m68k.org","avatar":"https://gravatar.com/avatar/8105b34f653a7b5b98e225e565b11ebcc762ad4ab1a9d905a4663db029a9e6bc?d=mp&s=160"},"body":"        Hi all,\n\nI'm using git-svn. Due to local policies and for compatibility with the other\ndevelopers using plain svn, I have to lock a file before committing anything to\nthe svn repository.\n\nHence I wrote a small wrapper script around \"git svn dcommit\", which basically\ndoes:\n\n| SVNROOT=$( ( cd ./$(git rev-parse --show-cdup) && git svn info --url ) )\n| SVNLOCKFILE=$SVNROOT/lockfile\n|\n| svn lock $SVNLOCKFILE\n| git svn dcommit $*\n| svn unlock $SVNLOCKFILE\n\nA while ago, I started seeing \"svn: Network connection closed unexpectedly\"\nmessages being printed. Unfortunately, I didn't really look into them at that\ntime, as everything seemed to continue working fine.\n\nRecently, we noticed concurrent commits, and discovered I no longer lock the\nlockfile. It seems that both the lock and unlock fail with\n\"svn: Network connection closed unexpectedly\", because $SVNROOT doesn't\ncontain the username I need to use for authentication.\n\nMy .git/config has\n\n| [svn-remote \"svn\"]\n|         url = svn+ssh://user@server/project\n\nBut \"git svn info --url\" only prints:\n\n| svn+ssh://server/project/sub/branches/branch\n\ni.e. the username part is missing.\nObviously \"git svn dcommit\" does use the correct URL.\n\nI'm using git version 1.7.0.4, but I also tried version 1.7.5.1.217.g4e3aa\nwith the same results.\n\nThe funny thing is that I tested that locking did work when I wrote my script.\nBut when I look at the history for git-svn.perl, I don't see any change that\ncaused it to break, or even work at all.\nNor do I have access to the same machine and software I originally used, as it\ngot upgraded in the mean time.\n\nI tried, \"git config --get svn-remote.svn.url\", but that only gives me\n\"svn+ssh://user@server/project\", i.e. it lacks the \"/sub/branches/branch\" part.\n\nDo you have any idea what's going on, or how to fix it?\nShouldn't \"git svn info --url\" include the username?\n\nThanks in advance!\n\nGr{oetje,eeting}s,\n\n                        Geert\n\n--\nGeert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org\n\nIn personal conversations with technical people, I call myself a hacker. But\nwhen I'm talking to journalists I just say \"programmer\" or something like that.\n                                -- Linus Torvalds\n"},{"id":"168071","messageId":"BANLkTik1n8SCVu1-EwVrhJ7rURtk16eA9A@mail.gmail.com","threadId":"27337","inReplyTo":"BANLkTinCx4pEycjGmWA=jZ8os7R3tZWXNQ@mail.gmail.com","subject":"Re: git svn info --url lacks username","fromName":"Geert Uytterhoeven","fromEmail":"geert@linux-m68k.org","sentAt":"2011-05-17T16:51:56Z","receivedAt":"2011-05-17T16:51:56Z","isPatch":false,"sender":{"key":"geert@linux-m68k.org","avatar":"https://gravatar.com/avatar/8105b34f653a7b5b98e225e565b11ebcc762ad4ab1a9d905a4663db029a9e6bc?d=mp&s=160"},"body":"On Thu, May 12, 2011 at 14:13, Geert Uytterhoeven <geert@linux-m68k.org> wrote:\n> I'm using git-svn. Due to local policies and for compatibility with the other\n> developers using plain svn, I have to lock a file before committing anything to\n> the svn repository.\n>\n> Hence I wrote a small wrapper script around \"git svn dcommit\", which basically\n> does:\n>\n> | SVNROOT=$( ( cd ./$(git rev-parse --show-cdup) && git svn info --url ) )\n> | SVNLOCKFILE=$SVNROOT/lockfile\n> |\n> | svn lock $SVNLOCKFILE\n> | git svn dcommit $*\n> | svn unlock $SVNLOCKFILE\n\n[...]\n\n> My .git/config has\n>\n> | [svn-remote \"svn\"]\n> |         url = svn+ssh://user@server/project\n>\n> But \"git svn info --url\" only prints:\n>\n> | svn+ssh://server/project/sub/branches/branch\n>\n> i.e. the username part is missing.\n> Obviously \"git svn dcommit\" does use the correct URL.\n\n[...]\n\n> I tried, \"git config --get svn-remote.svn.url\", but that only gives me\n> \"svn+ssh://user@server/project\", i.e. it lacks the \"/sub/branches/branch\" part.\n>\n> Do you have any idea what's going on, or how to fix it?\n> Shouldn't \"git svn info --url\" include the username?\n\nI ended up adding:\n\n| SVNURL=$(git config --get svn-remote.svn.url)\n| case $SVNURL in svn+ssh://*@*)\n|         SVNROOT=${SVNURL%%@*}@${SVNROOT#svn+ssh://}\n|         ;;\n| esac\n\nso it hacks in the username from the config file.\nBut I don't think that's the ideal solution?\n\nGr{oetje,eeting}s,\n\n                        Geert\n\n--\nGeert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org\n\nIn personal conversations with technical people, I call myself a hacker. But\nwhen I'm talking to journalists I just say \"programmer\" or something like that.\n                                -- Linus Torvalds\n"}]}