{"thread":{"id":"20645","subject":"[PATCH] GIT_SSH does not override ssh in git-svn","startedAt":"2009-08-17T21:09:12Z","lastAt":"2009-08-17T22:35:34Z","messageCount":4,"participants":["Karthik R","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"120991","messageId":"4A89C6F8.3010100@fastmail.fm","threadId":"20645","inReplyTo":null,"subject":"[PATCH] GIT_SSH does not override ssh in git-svn","fromName":"Karthik R","fromEmail":"karthikr@fastmail.fm","sentAt":"2009-08-17T21:09:12Z","receivedAt":"2009-08-17T21:09:12Z","isPatch":true,"sender":{"key":"karthikr@fastmail.fm","avatar":null},"body":"\n\nSigned-off-by: Karthik R <karthikr@fastmail.fm>\n---\n\nSetting GIT_SSH when using \"git svn clone svn+ssh://...\" does not \noverride the\ndefault ssh; SVN_SSH needs to be set instead. Corrected this.\n\nAlso, on Windows, SVN_SSH needs to be set with \\ escaped\n  e.g., \"C:\\\\PuTTY\\\\plink.exe\"\n\nSee http://code.google.com/p/msysgit/issues/detail?id=305\n\n git-svn.perl |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b0bfb74..c932b6e 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -21,6 +21,16 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || \n'git-svn';\n $Git::SVN::Ra::_log_window_size = 100;\n $Git::SVN::_minimize_url = 'unset';\n \n+my $git_ssh_user_set = 1 if defined $ENV{GIT_SSH};\n+if ($git_ssh_user_set) {\n+       # If GIT_SSH is set, also set SVN_SSH...\n+       $ENV{SVN_SSH} = $ENV{GIT_SSH};\n+       # ... and escape \\s in shell-variable on Windows\n+       if ($^O eq 'MSWin32' || $^O eq 'msys') {\n+               $ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n+       }\n+}\n+\n $Git::SVN::Log::TZ = $ENV{TZ};\n $ENV{TZ} = 'UTC';\n $| = 1; # unbuffer STDOUT\n-- \n1.5.4.3\n"},{"id":"120998","messageId":"alpine.DEB.1.00.0908172336410.8306@pacific.mpi-cbg.de","threadId":"20645","inReplyTo":"4A89C6F8.3010100@fastmail.fm","subject":"Re: [PATCH] GIT_SSH does not override ssh in git-svn","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-08-17T21:38:36Z","receivedAt":"2009-08-17T21:38:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Aug 2009, Karthik R wrote:\n\n> \n> \n> Signed-off-by: Karthik R <karthikr@fastmail.fm>\n> ---\n> \n> Setting GIT_SSH when using \"git svn clone svn+ssh://...\" does not override the\n> default ssh; SVN_SSH needs to be set instead. Corrected this.\n> \n> Also, on Windows, SVN_SSH needs to be set with \\ escaped\n>  e.g., \"C:\\\\PuTTY\\\\plink.exe\"\n> \n> See http://code.google.com/p/msysgit/issues/detail?id=305\n\nThis probably all wants to go into the commit message: it is very useful \ninformation!\n\nBesides, I think you would like to formulate the commit subject more \npositive: \"Respect GIT_SSH in git-svn\" or some such.  After all, you fix \nthe issue.  IOW use the imperative: you command git-svn to behave ;-)\n\nCiao,\nDscho\n"},{"id":"121000","messageId":"7vhbw6qfuq.fsf@alter.siamese.dyndns.org","threadId":"20645","inReplyTo":"4A89C6F8.3010100@fastmail.fm","subject":"Re: [PATCH] GIT_SSH does not override ssh in git-svn","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-08-17T21:40:13Z","receivedAt":"2009-08-17T21:40:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Karthik R <karthikr@fastmail.fm> writes:\n\n> +my $git_ssh_user_set = 1 if defined $ENV{GIT_SSH};\n> +if ($git_ssh_user_set) {\n> +       # If GIT_SSH is set, also set SVN_SSH...\n> +       $ENV{SVN_SSH} = $ENV{GIT_SSH};\n> +       # ... and escape \\s in shell-variable on Windows\n> +       if ($^O eq 'MSWin32' || $^O eq 'msys') {\n> +               $ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n> +       }\n> +}\n> +\n\nWhy not just\n\n\tif (defined $ENV{GIT_SSH}) {\n        \t...\n\n???\n\n> $Git::SVN::Log::TZ = $ENV{TZ};\n> $ENV{TZ} = 'UTC';\n> $| = 1; # unbuffer STDOUT\n> -- \n> 1.5.4.3\n"},{"id":"121014","messageId":"4A89DB36.6060508@fastmail.fm","threadId":"20645","inReplyTo":"7vhbw6qfuq.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] GIT_SSH does not override ssh in git-svn","fromName":"Karthik R","fromEmail":"karthikr@fastmail.fm","sentAt":"2009-08-17T22:35:34Z","receivedAt":"2009-08-17T22:35:34Z","isPatch":true,"sender":{"key":"karthikr@fastmail.fm","avatar":null},"body":"Junio C Hamano wrote:\n> Karthik R <karthikr@fastmail.fm> writes:\n>\n>   \n>> +my $git_ssh_user_set = 1 if defined $ENV{GIT_SSH};\n>> +if ($git_ssh_user_set) {\n>> +       # If GIT_SSH is set, also set SVN_SSH...\n>> +       $ENV{SVN_SSH} = $ENV{GIT_SSH};\n>> +       # ... and escape \\s in shell-variable on Windows\n>> +       if ($^O eq 'MSWin32' || $^O eq 'msys') {\n>> +               $ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g;\n>> +       }\n>> +}\n>> +\n>>     \n>\n> Why not just\n>\n> \tif (defined $ENV{GIT_SSH}) {\n>         \t...\n>\n> ???\n>\n>   \n>> $Git::SVN::Log::TZ = $ENV{TZ};\n>> $ENV{TZ} = 'UTC';\n>> $| = 1; # unbuffer STDOUT\n>> -- \n>> 1.5.4.3\n>>     \nI think I had trouble getting that to work correctly on my Windows XP\nbox... I didn't dig into that (my perl was exactly 1 day old).\n\nDoes this look better (it does to me) ? If so, I can resend the patch\naddressing Dscho's comments too.\n\n+# If GIT_SSH is set, also set SVN_SSH...\n+$ENV{SVN_SSH} = $ENV{GIT_SSH} if defined $ENV{GIT_SSH};\n+# ... and escape \\s in shell-variable on Windows\n+if ($^O eq 'MSWin32' || $^O eq 'msys') {\n+       $ENV{SVN_SSH} =~ s/\\\\/\\\\\\\\/g if defined $ENV{SVN_SSH};\n+}\n+\n"}]}