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

Re: cvsimport still not working with cvsnt

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 29, 2011, 22:27 UTC
Message-ID
<20110429222729.GB5916@elie>
In-Reply-To
<4DBA3E14.7090602@burntmail.com>
Guy Rouillier wrote:
Show 5 quoted lines
> Note that I've left this test in, although I still think it is a bad idea:
>
>    elsif (!$pass) {
>       $pass = "A";
>    }
[...]
> But that doesn't explain why it was put in there in the first
> place.  I still say a better idea, if we don't want to allow an empty
> password, is to error out rather than silently set a bogus password.

It might be a good idea after all to do something else in that case (as a separate patch :)), but it would require a little investigation. Isn't the convention in CVS for anonymous pserver access to accept an arbitrary password?

Show 5 quoted lines
> The CVS password file separates tokens with a space character, while
> the CVSNT password file separates tokens with an equal (=) character.
> Add a sub find_password_entry that accepts the password file name
> and a delimiter to eliminate code duplication.
> ---
Sounds sensible to my untrained ears.  Sign-off?
[...]
Show 21 quoted lines
> +++ b/git-cvsimport.perl
> @@ -227,6 +227,30 @@ sub new {
>  	return $self;
>  }
> 
> +sub find_password_entry {
> +	my ($cvspass, @cvsroot) = @_;
> +	my ($file, $delim) = @$cvspass;
> +	my $pass;
> +	local ($_);
> +
> +	if (open(my $fh, $file)) {
> +		# :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z
> +		while (<$fh>) {
> +			chomp;
> +			s/^\/\d+\s+//;
> +			my ($w, $p) = split($delim,$_,2);
> +			for my $cvsroot (@cvsroot) {
> +				if ($w eq $cvsroot) {
> +					$pass = $p;
> +					last;

In the old code, this "last" applied to the while loop, while in the new code it applies to the for loop. Intentional?

[...]
> +			if (1 < @loc) {
> +				die("More than one cvs password files have ".
> +				    "entries for CVSROOT $opt_d: @loc");

Grammar nit: "More than one" is singular (weird, eh?). It might be clearer to say:

	"Multiple cvs password files have " .
	"entries for CVSROOT $opt_d: @loc"
(or "Both cvs password files").
Thanks again, and hope that helps.

Regards, Jonathan

Previous: Guy RouillierNext: Guy Rouillier
Message 28 of 32 in “cvsimport still not working with cvsnt”
  1. Guy RouillierDec 20, 2010
  2. Jonathan NiederDec 20, 2010
  3. Emil MedveDec 21, 2010
  4. Guy RouillierDec 22, 2010
  5. Guy RouillierJan 10, 2011
  6. Martin LanghoffJan 10, 2011
  7. Guy RouillierJan 14, 2011
  8. Jonathan NiederJan 14, 2011
  9. Junio C HamanoJan 14, 2011
  10. Guy RouillierJan 30, 2011
  11. Martin LanghoffJan 30, 2011
  12. Junio C HamanoFeb 10, 2011
  13. Guy RouillierFeb 18, 2011
  14. Junio C HamanoFeb 18, 2011
  15. Guy RouillierFeb 19, 2011
  16. Junio C HamanoFeb 20, 2011
  17. Guy RouillierFeb 21, 2011
  18. Junio C HamanoFeb 21, 2011
  19. Junio C HamanoFeb 22, 2011
  20. Martin LanghoffFeb 22, 2011
  21. Guy RouillierFeb 23, 2011
  22. Junio C HamanoFeb 23, 2011
  23. Guy RouillierFeb 23, 2011
  24. Junio C HamanoFeb 23, 2011
  25. Guy RouillierFeb 27, 2011
  26. Junio C HamanoFeb 27, 2011
  27. Guy RouillierApr 29, 2011
  28. Jonathan NiederApr 29, 2011
  29. Guy RouillierMay 1, 2011
  30. Junio C HamanoMay 1, 2011
  31. Junio C HamanoFeb 23, 2011
  32. Guy RouillierFeb 24, 2011

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.