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

[PATCH] git-cvsimport: fix handling of user name when it is not set in CVSROOT

From
GHGordon Hopper <g.hopper@computer.org>
Date
Nov 8, 2007, 20:15 UTC
Message-ID
<3b3fddfa0711081215w7aed667boa00ea134c0798a9@mail.gmail.com>

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
Message 1 of 1 in “git-cvsimport: fix handling of user name when it is not set in CVSROOT”
  1. git-cvsimport: fix handling of user name when it is not set in CVSROOTGordon Hopper, Nov 8, 2007

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.