git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-cvsimport: fix handling of user name when it is not set in CVSROOT
@ 2007-11-08 20:15 Gordon Hopper
  0 siblings, 0 replies; only message in thread
From: Gordon Hopper @ 2007-11-08 20:15 UTC (permalink / raw)
  To: git; +Cc: gitster

The cvs programs do not default to "anonymous" as the user name, but use the
currently logged in user.  This patch more closely matches the cvs behavior.

Signed-off-by: Gordon Hopper <g.hopper@computer.org>
---
 git-cvsimport.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e4bc2b5..efa6a0c 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -223,7 +223,8 @@ sub conn {
 			}
 		}

-		$user="anonymous" unless defined $user;
+		# if username is not explicit in CVSROOT, then use current user, as cvs would
+		$user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} ||
"anonymous") unless $user;
 		my $rr2 = "-";
 		unless ($port) {
 			$rr2 = ":pserver:$user\@$serv:$repo";
-- 
1.5.3.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-08 20:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08 20:15 [PATCH] git-cvsimport: fix handling of user name when it is not set in CVSROOT Gordon Hopper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).