git-svn - username/password

Previous thread: Should update-server-info be on by default? by Carl Worth on Monday, January 15, 2007 - 3:48 pm. (1 message)

Next thread: Re: Importing from tarballs; add, rm, update-index? by Jakub Narebski on Monday, January 15, 2007 - 5:51 pm. (1 message)
From: Randal L. Schwartz
Date: Monday, January 15, 2007 - 4:25 pm

It's not clear from the docs where I'm supposed to put a subversion
username/password in git-svn.  In fact, git-svn makes absolutely no mention of
password.  And I see there's some --username=%s kind of stuff in the arg
parsing, but I'm not able to seem to make it work.  (At one point, git-svn
init actually created a subdir named "http:"... oops!)

Eric?  Or anyone?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-

From: Eric Wong
Date: Monday, January 15, 2007 - 5:41 pm

git-svn fetch --username <username> should work with recent-ish git-svn
(since around Thanksgiving); and eventually prompt you for the password
(just like svn does).

If you're using older versions, just run
   `svn log -rHEAD --username <username> <repository>'
and have it cache your password.

-- 
Eric Wong
-

From: Randal L. Schwartz
Date: Monday, January 15, 2007 - 5:48 pm

>>>>> "Eric" == Eric Wong <normalperson@yhbt.net> writes:

Eric> git-svn fetch --username <username> should work with recent-ish git-svn
Eric> (since around Thanksgiving); and eventually prompt you for the password
Eric> (just like svn does).

The prompts are broken... they're not being flushed properly.
Once I knew it was talking to me, and not just stalled, I could
type in the password at the right time.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-

From: Eric Wong
Date: Monday, January 15, 2007 - 9:20 pm

That's odd.  I have $| = 1; at the beginning of git-svn.  Maybe
some module somewhere is unsetting $|...

Anyways, I think STDERR is more correct for prompts.

From: Eric Wong <normalperson@yhbt.net>
Date: Mon, 15 Jan 2007 20:15:55 -0800
Subject: [PATCH] git-svn: print and flush authentication prompts to STDERR

People that redirect STDOUT output should always see STDERR
prompts interactively.

STDERR should always be flushed without buffering, so
they should always show up.  If that is unset, we still
explicitly flush by calling STDERR->flush.

The svn command-line client prompts to STDERR, too.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

diff --git a/git-svn.perl b/git-svn.perl
index 9986a0c..b8ede9c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1918,7 +1918,8 @@ sub _simple_prompt {
 	$default_username = $_username if defined $_username;
 	if (defined $default_username && length $default_username) {
 		if (defined $realm && length $realm) {
-			print "Authentication realm: $realm\n";
+			print STDERR "Authentication realm: $realm\n";
+			STDERR->flush;
 		}
 		$cred->username($default_username);
 	} else {
@@ -1933,36 +1934,38 @@ sub _simple_prompt {
 sub _ssl_server_trust_prompt {
 	my ($cred, $realm, $failures, $cert_info, $may_save, $pool) = @_;
 	$may_save = undef if $_no_auth_cache;
-	print "Error validating server certificate for '$realm':\n";
+	print STDERR "Error validating server certificate for '$realm':\n";
 	if ($failures & $SVN::Auth::SSL::UNKNOWNCA) {
-		print " - The certificate is not issued by a trusted ",
+		print STDERR " - The certificate is not issued by a trusted ",
 		      "authority. Use the\n",
 	              "   fingerprint to validate the certificate manually!\n";
 	}
 	if ($failures & $SVN::Auth::SSL::CNMISMATCH) {
-		print " - The certificate hostname does not match.\n";
+		print STDERR " - The certificate hostname does not match.\n";
 	}
 	if ($failures & $SVN::Auth::SSL::NOTYETVALID) {
-		print " - The ...
Previous thread: Should update-server-info be on by default? by Carl Worth on Monday, January 15, 2007 - 3:48 pm. (1 message)

Next thread: Re: Importing from tarballs; add, rm, update-index? by Jakub Narebski on Monday, January 15, 2007 - 5:51 pm. (1 message)