{"thread":{"id":"15085","subject":"Problem with git-svn","startedAt":"2008-08-19T13:41:28Z","lastAt":"2008-08-21T06:34:48Z","messageCount":4,"participants":["Boaz Stuller","Eric Wong"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"87691","messageId":"5979e28c0808190641l343ed48fi75c55f9f0cdb1bcf@mail.gmail.com","threadId":"15085","inReplyTo":null,"subject":"Problem with git-svn","fromName":"Boaz Stuller","fromEmail":"boazstuller@gmail.com","sentAt":"2008-08-19T13:41:28Z","receivedAt":"2008-08-19T13:41:28Z","isPatch":false,"sender":{"key":"boazstuller@gmail.com","avatar":null},"body":"I'm having a problem with git-svn.  I was connecting to a remote svn\nrepository via the svn+ssh:// protocol using an embedded username in\nthe url, i.e svn+ssh://boazstuller@svn.example.com/some/complicated/path.\n When I upgraded to 1.6.0, 'git svn dcommit' stopped working and\ninstead kept asking me for a password.   I tracked the problem down to\nthe following commit:\n\ncommit ba24e7457aa1f958370bbb67dfb97e3ec806fd4a\nAuthor: Eric Wong <normalperson@yhbt.net>\nDate:   Thu Aug 7 02:06:16 2008 -0700\n    git-svn: add ability to specify --commit-url for dcommit\n\nI don't know perl, but the problem seems to be where around line 446,\n'$gs->full_url' gets changed to  '$url'.  Apparently, $gs->full_url\ncontained the embedded username but $url has it stripped out, i.e\nsvn+ssh://svn.example.com/some/complicated/path , so ssh can't tell\nwhat username I'm trying to log in as.\n\nBest wishes,\nBo\n"},{"id":"87803","messageId":"20080820080528.GA16665@untitled","threadId":"15085","inReplyTo":"5979e28c0808190641l343ed48fi75c55f9f0cdb1bcf@mail.gmail.com","subject":"Re: Problem with git-svn","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-20T08:11:05Z","receivedAt":"2008-08-20T08:11:05Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Boaz Stuller <boazstuller@gmail.com> wrote:\n> I'm having a problem with git-svn.  I was connecting to a remote svn\n> repository via the svn+ssh:// protocol using an embedded username in\n> the url, i.e svn+ssh://boazstuller@svn.example.com/some/complicated/path.\n>  When I upgraded to 1.6.0, 'git svn dcommit' stopped working and\n> instead kept asking me for a password.   I tracked the problem down to\n> the following commit:\n> \n> commit ba24e7457aa1f958370bbb67dfb97e3ec806fd4a\n> Author: Eric Wong <normalperson@yhbt.net>\n> Date:   Thu Aug 7 02:06:16 2008 -0700\n>     git-svn: add ability to specify --commit-url for dcommit\n> \n> I don't know perl, but the problem seems to be where around line 446,\n> '$gs->full_url' gets changed to  '$url'.  Apparently, $gs->full_url\n> contained the embedded username but $url has it stripped out, i.e\n> svn+ssh://svn.example.com/some/complicated/path , so ssh can't tell\n> what username I'm trying to log in as.\n\nHi Boaz, thanks for tracking this down.  The following patch should\nfix your issue (and another potential one I noticed).\n\nI've lightly tested it and it appears to work for me.\n\n>From de9e79c4a7bdec5481dc0d19ae21ced3a403c0c9 Mon Sep 17 00:00:00 2001\nFrom: Eric Wong <normalperson@yhbt.net>\nDate: Wed, 20 Aug 2008 00:30:06 -0700\nSubject: [PATCH] git-svn: fix dcommit to urls with embedded usernames\n\nDon't rely on the extracted URL from working_head_info since\nthat has the username removed.  Instead use the $gs->full_url\nmethod (as before with ba24e7457aa1f958370bbb67dfb97e3ec806fd4a)\nto give us the URL to commit to if --commit-url is not\nspecified.\n\nAditionally, since we clean usernames from URLs, checking the\nURL after rebase can fail because it doesn't match the URL we\nused to commit; so unconditionally provide a username-free\nURL for checking the result of the refetch.\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    8 +++++---\n 1 files changed, 5 insertions(+), 3 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 099fd02..7a1d26d 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -421,7 +421,7 @@ sub cmd_dcommit {\n \t$head ||= 'HEAD';\n \tmy @refs;\n \tmy ($url, $rev, $uuid, $gs) = working_head_info($head, \\@refs);\n-\t$url = $_commit_url if defined $_commit_url;\n+\t$url = defined $_commit_url ? $_commit_url : $gs->full_url;\n \tmy $last_rev = $_revision if defined $_revision;\n \tif ($url) {\n \t\tprint \"Committing to $url ...\\n\";\n@@ -437,6 +437,8 @@ sub cmd_dcommit {\n \t\t     \"If these changes depend on each other, re-running \",\n \t\t     \"without --no-rebase may be required.\"\n \t}\n+\tmy $expect_url = $url;\n+\tGit::SVN::remove_username($expect_url);\n \twhile (1) {\n \t\tmy $d = shift @$linear_refs or last;\n \t\tunless (defined $last_rev) {\n@@ -511,9 +513,9 @@ sub cmd_dcommit {\n \t\t\t\t\t  $gs->refname,\n \t\t\t\t\t  \"\\nBefore dcommitting\";\n \t\t\t\t}\n-\t\t\t\tif ($url_ ne $url) {\n+\t\t\t\tif ($url_ ne $expect_url) {\n \t\t\t\t\tfatal \"URL mismatch after rebase: \",\n-\t\t\t\t\t      \"$url_ != $url\";\n+\t\t\t\t\t      \"$url_ != $expect_url\";\n \t\t\t\t}\n \t\t\t\tif ($uuid_ ne $uuid) {\n \t\t\t\t\tfatal \"uuid mismatch after rebase: \",\n-- \nEric Wong\n"},{"id":"87832","messageId":"5979e28c0808201045i2c525d7dx7fc8d70a67e9c9ef@mail.gmail.com","threadId":"15085","inReplyTo":"20080820080528.GA16665@untitled","subject":"Re: Problem with git-svn","fromName":"Boaz Stuller","fromEmail":"boazstuller@gmail.com","sentAt":"2008-08-20T17:45:37Z","receivedAt":"2008-08-20T17:45:37Z","isPatch":false,"sender":{"key":"boazstuller@gmail.com","avatar":null},"body":"On Wed, Aug 20, 2008 at 4:11 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> Boaz Stuller <boazstuller@gmail.com> wrote:\n>> I'm having a problem with git-svn.  I was connecting to a remote svn\n>> repository via the svn+ssh:// protocol using an embedded username in\n>> the url, i.e svn+ssh://boazstuller@svn.example.com/some/complicated/path.\n>>  When I upgraded to 1.6.0, 'git svn dcommit' stopped working and\n>> instead kept asking me for a password.   I tracked the problem down to\n>> the following commit:\n>>\n>> commit ba24e7457aa1f958370bbb67dfb97e3ec806fd4a\n>> Author: Eric Wong <normalperson@yhbt.net>\n>> Date:   Thu Aug 7 02:06:16 2008 -0700\n>>     git-svn: add ability to specify --commit-url for dcommit\n>>\n>> I don't know perl, but the problem seems to be where around line 446,\n>> '$gs->full_url' gets changed to  '$url'.  Apparently, $gs->full_url\n>> contained the embedded username but $url has it stripped out, i.e\n>> svn+ssh://svn.example.com/some/complicated/path , so ssh can't tell\n>> what username I'm trying to log in as.\n>\n> Hi Boaz, thanks for tracking this down.  The following patch should\n> fix your issue (and another potential one I noticed).\n>\n> I've lightly tested it and it appears to work for me.\n>\n\nI only tested with a couple commits too, but your patch works\nperfectly for me.\n\nThanks,\nBo\n"},{"id":"87947","messageId":"20080821063448.GA2392@untitled","threadId":"15085","inReplyTo":"5979e28c0808201045i2c525d7dx7fc8d70a67e9c9ef@mail.gmail.com","subject":"Re: Problem with git-svn","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-21T06:34:48Z","receivedAt":"2008-08-21T06:34:48Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Boaz Stuller <boazstuller@gmail.com> wrote:\n> On Wed, Aug 20, 2008 at 4:11 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> > Boaz Stuller <boazstuller@gmail.com> wrote:\n> >> I'm having a problem with git-svn.  I was connecting to a remote svn\n> >> repository via the svn+ssh:// protocol using an embedded username in\n> >> the url, i.e svn+ssh://boazstuller@svn.example.com/some/complicated/path.\n> >>  When I upgraded to 1.6.0, 'git svn dcommit' stopped working and\n> >> instead kept asking me for a password.   I tracked the problem down to\n> >> the following commit:\n> >>\n> >> commit ba24e7457aa1f958370bbb67dfb97e3ec806fd4a\n> >> Author: Eric Wong <normalperson@yhbt.net>\n> >> Date:   Thu Aug 7 02:06:16 2008 -0700\n> >>     git-svn: add ability to specify --commit-url for dcommit\n> >>\n> >> I don't know perl, but the problem seems to be where around line 446,\n> >> '$gs->full_url' gets changed to  '$url'.  Apparently, $gs->full_url\n> >> contained the embedded username but $url has it stripped out, i.e\n> >> svn+ssh://svn.example.com/some/complicated/path , so ssh can't tell\n> >> what username I'm trying to log in as.\n> >\n> > Hi Boaz, thanks for tracking this down.  The following patch should\n> > fix your issue (and another potential one I noticed).\n> >\n> > I've lightly tested it and it appears to work for me.\n> \n> I only tested with a couple commits too, but your patch works\n> perfectly for me.\n\nJunio: please apply my patch to maint, thank you.\n\n-- \nEric Wong\n"}]}