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

Re: [PATCH][resend] git-svn: Respect GIT_SSH setting

From
KRKarthik R <karthikr@fastmail.fm>
Date
Aug 17, 2009, 23:47 UTC
Message-ID
<4A89EC07.2010402@fastmail.fm>
In-Reply-To
<7vzl9ykovh.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 19 quoted lines
> Karthik R <karthikr@fastmail.fm> writes:
>
>   
>> +# If GIT_SSH is set, also set SVN_SSH...
>> +$ENV{SVN_SSH} = $ENV{GIT_SSH} if defined $ENV{GIT_SSH};
>> +# ... and escape \s in shell-variable on Windows
>> +if ($^O eq 'MSWin32' || $^O eq 'msys') {
>> +       $ENV{SVN_SSH} =~ s/\\/\\\\/g if defined $ENV{SVN_SSH};
>> +}
>> +
>>     
>
> Two questions.
>
>  - What if a user has SVN_SSH exported _and_ wants to use a different one
>    from the one s/he uses for git?  Naturally such a user would set both
>    environment variables and differently, but this seems to override the
>    value in SVN_SSH;
>   
Do you mean user wants to use a different one with "git svn ... 
svn+ssh://" (than the one with "git clone ssh://") ?
In this case
- defining SVN_SSH, but not GIT_SSH will still work (with this patch, 
GIT_SSH overrides)
- but SVN_SSH needs to have \\s.
So unless the user already knew of this quirk, we'll only see unescaped 
\s - so it *does* make sense to escape the \s (if the user knew, then 
too many escaped \s still work).
>  - Can a user have SVN_SSH exported, on MSWin32 or msys, and use svn
>    outside git?  If so, what does the value of SVN_SSH look like?  Does it
>    typically have necessary doubling of backslashes already?
>   

With subversion for Windows, these \\s are not needed (but doesn't cause any break). The doubling is something to do with the bash (in msys) I think.

Show 13 quoted lines
> What I am getting at is, if the patch should look something like this
> instead:
>
> 	if (! exists $ENV{SVN_SSH}) {
> 		if (exists $ENV{GIT_SSH}) {
> 			$ENV{SVN_SSH} = $ENV{GIT_SSH};
> 			if ($^O eq 'MSWin32' || $^O eq 'msys') {
>                                $ENV{SVN_SSH} =~ s/\\/\\\\/g;
> 			}
> 		}
> 	}
>
>   
Previous: Junio C HamanoNext: Karthik R
Message 6 of 8 in “[resend] git-svn: Respect GIT_SSH setting”
  1. [resend] git-svn: Respect GIT_SSH settingKarthik R, Aug 17, 2009
  2. Johannes SchindelinAug 17, 2009
  3. Karthik RAug 18, 2009
  4. Johannes SchindelinAug 18, 2009
  5. Junio C HamanoAug 17, 2009
  6. Karthik RAug 17, 2009
  7. Karthik RAug 18, 2009
  8. Junio C HamanoAug 18, 2009

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.