git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Guy Rouillier <guyr@burntmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Martin Langhoff <martin@laptop.org>,
	Emil Medve <Emilian.Medve@freescale.com>,
	git <git@vger.kernel.org>, Pascal Obry <pascal@obry.net>,
	Clemens Buchacher <drizzd@aon.at>
Subject: Re: cvsimport still not working with cvsnt
Date: Fri, 29 Apr 2011 17:27:29 -0500	[thread overview]
Message-ID: <20110429222729.GB5916@elie> (raw)
In-Reply-To: <4DBA3E14.7090602@burntmail.com>

Guy Rouillier wrote:

> 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?

> 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?

[...]
> +++ 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

  reply	other threads:[~2011-04-29 22:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20  4:05 cvsimport still not working with cvsnt Guy Rouillier
2010-12-20 21:36 ` Jonathan Nieder
2010-12-21 22:09   ` Emil Medve
2010-12-22  5:43     ` Guy Rouillier
2011-01-10  7:33       ` Guy Rouillier
2011-01-10 15:38         ` Martin Langhoff
2011-01-14  6:38           ` Guy Rouillier
2011-01-14  7:44             ` Jonathan Nieder
2011-01-14 21:49               ` Junio C Hamano
2011-01-30  6:33                 ` Guy Rouillier
2011-01-30 20:19                   ` Martin Langhoff
2011-02-10 22:01                     ` Junio C Hamano
2011-02-18  6:26                       ` Guy Rouillier
2011-02-18 18:34                         ` Junio C Hamano
2011-02-19  7:17                           ` Guy Rouillier
2011-02-20  7:21                             ` Junio C Hamano
2011-02-21  4:30                               ` Guy Rouillier
2011-02-21 23:33                                 ` Junio C Hamano
2011-02-22 23:08                                   ` Junio C Hamano
2011-02-22 23:50                                     ` Martin Langhoff
2011-02-23  0:08                                       ` Guy Rouillier
2011-02-23  0:45                                         ` Junio C Hamano
2011-02-23  2:33                                           ` Guy Rouillier
2011-02-23  5:24                                             ` Junio C Hamano
2011-02-27  5:20                                           ` Guy Rouillier
2011-02-27  8:26                                             ` Junio C Hamano
2011-04-29  4:27                                               ` Guy Rouillier
2011-04-29 22:27                                                 ` Jonathan Nieder [this message]
2011-05-01  5:33                                                   ` Guy Rouillier
2011-05-01 18:44                                                     ` Junio C Hamano
2011-02-23  0:42                                       ` Junio C Hamano
2011-02-24  3:14                                         ` Guy Rouillier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110429222729.GB5916@elie \
    --to=jrnieder@gmail.com \
    --cc=Emilian.Medve@freescale.com \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=guyr@burntmail.com \
    --cc=martin@laptop.org \
    --cc=pascal@obry.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).