{"thread":{"id":"10740","subject":"[PATCH] git-cvsimport: fix handling of user name when it is not set in CVSROOT","startedAt":"2007-11-08T20:15:20Z","lastAt":"2007-11-08T20:15:20Z","messageCount":1,"participants":["Gordon Hopper"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58931","messageId":"3b3fddfa0711081215w7aed667boa00ea134c0798a9@mail.gmail.com","threadId":"10740","inReplyTo":null,"subject":"[PATCH] git-cvsimport: fix handling of user name when it is not set in CVSROOT","fromName":"Gordon Hopper","fromEmail":"g.hopper@computer.org","sentAt":"2007-11-08T20:15:20Z","receivedAt":"2007-11-08T20:15:20Z","isPatch":true,"sender":{"key":"g.hopper@computer.org","avatar":null},"body":"The cvs programs do not default to \"anonymous\" as the user name, but use the\ncurrently logged in user.  This patch more closely matches the cvs behavior.\n\nSigned-off-by: Gordon Hopper <g.hopper@computer.org>\n---\n git-cvsimport.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-cvsimport.perl b/git-cvsimport.perl\nindex e4bc2b5..efa6a0c 100755\n--- a/git-cvsimport.perl\n+++ b/git-cvsimport.perl\n@@ -223,7 +223,8 @@ sub conn {\n \t\t\t}\n \t\t}\n\n-\t\t$user=\"anonymous\" unless defined $user;\n+\t\t# if username is not explicit in CVSROOT, then use current user, as cvs would\n+\t\t$user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} ||\n\"anonymous\") unless $user;\n \t\tmy $rr2 = \"-\";\n \t\tunless ($port) {\n \t\t\t$rr2 = \":pserver:$user\\@$serv:$repo\";\n-- \n1.5.3.5\n"}]}