From: Guy Rouillier <hidden> Date: 2016-06-15 22:50:16
I'm going to try sending this blind, as the mailing list has sent me the
promised authorization key after 24 hrs.
I'm brand new to git. We'll be moving over from CVS, so I imported a
small part of our CVS repository to start learning git. We use the
CVSNT server, and git-cvsimport was failing with "I HATE YOU". I
finally found the problems, both of which were reported in 2008 here:
http://kerneltrap.org/mailarchive/git/2008/3/13/1157364
However, these changes do not appear in the version 1.7.2.2 that Gentoo
supplies. I checked the 1.7.3-rc2 source and the changes are not in
there either.
I do see one possible issue with the supplied modifications. At work,
we upgraded from CVS to CVSNT. So, my home directory has both .cvspass
(from the original CVS) and .cvs/cvspass (after the conversion to
CVSNT.) Sloppy housekeeping on my part, I admit, but probably not
uncommon. The supplied patch would pick up the original CVS file and
would fail. (BTW, this is true only of the git-cvsimport.perl script
itself; cvsps must shell out to the installed CVS client (in my case,
cvsnt), because when I invoked that manually, it worked.)
So, I would advise checking to see if both files exist, and if so exit
with an error. Unless cvsimport wants to get real fancy and shell out
to the installed cvs client to try to figure out what is installed,
there is no way to tell which cvspass file is actively being used. I
don't recommend trying to figure this out, as the user's intent is unclear.
--
Guy Rouillier
I do see one possible issue with the supplied modifications. At
work, we upgraded from CVS to CVSNT. So, my home directory has both
.cvspass (from the original CVS) and .cvs/cvspass (after the
conversion to CVSNT.) Sloppy housekeeping on my part, I admit, but
probably not uncommon. The supplied patch would pick up the
original CVS file and would fail. (BTW, this is true only of the
git-cvsimport.perl script itself; cvsps must shell out to the
installed CVS client (in my case, cvsnt), because when I invoked
that manually, it worked.)
So, I would advise checking to see if both files exist, and if so
exit with an error. Unless cvsimport wants to get real fancy and
shell out to the installed cvs client to try to figure out what is
installed, there is no way to tell which cvspass file is actively
being used. I don't recommend trying to figure this out, as the
user's intent is unclear.
I don't remember why, but that patch didn't get enough interest
quoted
I do see one possible issue with the supplied modifications. At
work, we upgraded from CVS to CVSNT. So, my home directory has both
.cvspass (from the original CVS) and .cvs/cvspass (after the
conversion to CVSNT.) Sloppy housekeeping on my part, I admit, but
probably not uncommon. The supplied patch would pick up the
original CVS file and would fail. (BTW, this is true only of the
git-cvsimport.perl script itself; cvsps must shell out to the
installed CVS client (in my case, cvsnt), because when I invoked
that manually, it worked.)
So, I would advise checking to see if both files exist, and if so
exit with an error. Unless cvsimport wants to get real fancy and
shell out to the installed cvs client to try to figure out what is
installed, there is no way to tell which cvspass file is actively
being used. I don't recommend trying to figure this out, as the
user's intent is unclear.
Thanks, sounds sane to me. Care to write a patch?
If you care enough about this scenario, how about search for the
relevant <CVSROOT, password> in both files. If you find just one pair or
if you find a pair in both files and they are "equal" then just use it.
If you find two pairs, one in each file, use the one from the file with
a newer modified time-stamp. In a migration scenario such as this, you'd
imaging the "old" file will get stale after a while. Not perfect, but
some informational messages in case of a duplicate would help the user
clarify their intentions
Additionally/Alternatively just add a command line parameter to allow
the user to explicitly specify a cvspass file
Cheers,
Emil.
I don't remember why, but that patch didn't get enough interest
quoted
quoted
I do see one possible issue with the supplied modifications. At
work, we upgraded from CVS to CVSNT. So, my home directory has both
.cvspass (from the original CVS) and .cvs/cvspass (after the
conversion to CVSNT.) Sloppy housekeeping on my part, I admit, but
probably not uncommon. The supplied patch would pick up the
original CVS file and would fail. (BTW, this is true only of the
git-cvsimport.perl script itself; cvsps must shell out to the
installed CVS client (in my case, cvsnt), because when I invoked
that manually, it worked.)
So, I would advise checking to see if both files exist, and if so
exit with an error. Unless cvsimport wants to get real fancy and
shell out to the installed cvs client to try to figure out what is
installed, there is no way to tell which cvspass file is actively
being used. I don't recommend trying to figure this out, as the
user's intent is unclear.
Thanks, sounds sane to me. Care to write a patch?
If you care enough about this scenario, how about search for the
relevant<CVSROOT, password> in both files. If you find just one pair or
if you find a pair in both files and they are "equal" then just use it.
If you find two pairs, one in each file, use the one from the file with
a newer modified time-stamp. In a migration scenario such as this, you'd
imaging the "old" file will get stale after a while. Not perfect, but
some informational messages in case of a duplicate would help the user
clarify their intentions
Additionally/Alternatively just add a command line parameter to allow
the user to explicitly specify a cvspass file
Emil and Jonathan, thanks for the feedback. Perl is not my strong
point, but I'll take a crack at it over the upcoming holidays. I'm
inclined not to get too fancy and try to second-guess the user's
environment. Perhaps he has both cvs and cvsnt installed for some
reason (testing one, using the other for regular work); perhaps a tool
installed one or the other and he doesn't even know he has them both. Etc.
So, at most I can see, as Emil suggested, seeing if the entry exists in
both files and is the same in both. If so, or if the entry is only in
one of them, then just use the entry. However, if the entry is in both
files and is different, I'd prefer to just exit with an error and have
the user clarify his environment.
--
Guy Rouillier
From: Guy Rouillier <hidden> Date: 2016-06-15 22:50:21
On 12/22/2010 12:43 AM, Guy Rouillier wrote:
Emil and Jonathan, thanks for the feedback. Perl is not my strong point,
but I'll take a crack at it over the upcoming holidays. I'm inclined not
to get too fancy and try to second-guess the user's environment. Perhaps
he has both cvs and cvsnt installed for some reason (testing one, using
the other for regular work); perhaps a tool installed one or the other
and he doesn't even know he has them both. Etc.
So, at most I can see, as Emil suggested, seeing if the entry exists in
both files and is the same in both. If so, or if the entry is only in
one of them, then just use the entry. However, if the entry is in both
files and is different, I'd prefer to just exit with an error and have
the user clarify his environment.
Here is my patch for accomplishing the above. As this is my first time
submitting a patch, please let me know the correct procedure if
submitting a diff here is not appropriate. Thanks.
@@ -260,6 +260,8 @@ if ($pass) { $pass = $self->_scramble($pass); } else {+ # First try the original CVS location.+ open(H,$ENV{'HOME'}."/.cvspass") and do { # :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z while (<H>) {
@@ -272,7 +274,30 @@ } } };- $pass = "A" unless $pass;++ # Now try the CVSNT location.++ open(H,$ENV{'HOME'}."/.cvs/cvspass") and do {+ # :pserver:cvs@mea.tmt.tele.fi:/cvsroot/zmailer Ah<Z+ while (<H>) {+ chomp;+ s/^\/\d+\s+//;+ my ($w,$p) = split(/=/,$_,2);+ if ($w eq $rr or $w eq $rr2) {+ my $cvsntpass = $p;++ if (!$pass) {+ $pass = $cvsntpass;+ } elsif ($pass ne $cvsntpass) {+ die("CVSROOT found in both CVS and CVSNT cvspass files, passwords do not match\n");+ }+ last;+ }+ }+ };+++ die("Password not found for CVSROOT: $opt_d\n") unless $pass; } my ($s, $rep);
From: Martin Langhoff <hidden> Date: 2016-06-15 22:50:21
On Mon, Jan 10, 2011 at 2:33 AM, Guy Rouillier [off-list ref] wrote:
Here is my patch for accomplishing the above. As this is my first time
submitting a patch, please let me know the correct procedure if
submitting a diff here is not appropriate. Thanks.
The concept of what the patch is doing is good, but I'd recommend
@cvspasslocations = ($ENV{'HOME'}."/cvspass", $ENV{'HOME'}."/.cvs/cvspass")
foreach $cvspass (@cvspasslocations) {
open(...
and forgo the "matching" test.
cheers,
m
--
martin@laptop.org -- School Server Architect
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff
From: Guy Rouillier <hidden> Date: 2016-06-15 22:50:25
On 1/10/2011 10:38 AM, Martin Langhoff wrote:
On Mon, Jan 10, 2011 at 2:33 AM, Guy Rouillier[off-list ref] wrote:
quoted
Here is my patch for accomplishing the above. As this is my first time
submitting a patch, please let me know the correct procedure if
submitting a diff here is not appropriate. Thanks.
The concept of what the patch is doing is good, but I'd recommend
@cvspasslocations = ($ENV{'HOME'}."/cvspass", $ENV{'HOME'}."/.cvs/cvspass")
foreach $cvspass (@cvspasslocations) {
open(...
and forgo the "matching" test.
Martin, thanks for the reply. Have you had a chance to read the entire
thread? The matching test was suggested by Emil.
This is my first patch submission. What is the process for reaching
consensus?
--
Guy Rouillier
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:50:25
Guy Rouillier wrote:
Martin, thanks for the reply. Have you had a chance to read the
entire thread? The matching test was suggested by Emil.
To summarize, Emil originally (2008)[1] suggested only checking
~/.cvs/cvspass when ~/.cvspass fails to open. There was no response
at the time, perhaps because nobody interested saw the message.
Guy, two years later[2], wrote:
| I do see one possible issue with the supplied modifications. At work,
| we upgraded from CVS to CVSNT. So, my home directory has both
| .cvspass (from the original CVS) and .cvs/cvspass (after the conversion to
| CVSNT.) Sloppy housekeeping on my part, I admit, but probably not
| uncommon. The supplied patch would pick up the original CVS file and
| would fail. (BTW, this is true only of the git-cvsimport.perl script
and recommended erroring out if both files exist to make this easier
to diagnose.
Emil's advice: if this is an important use case to you, maybe it would
be served better by looking at both files?
This is my first patch submission. What is the process for reaching
consensus?
See Documentation/SubmittingPatches, "An ideal patch flow".
My take: you learn what you can from others' advice, but ultimately
the idea is to just make those changes that make the patch better
(where better can mean featureful or simpler and more maintainable ---
this is not meant to be an excuse for overengineering). In most cases
apparent conflicts are not real conflicts at all but signs of distinct
design goals to be balanced or reconciled.
Hope that helps,
Jonathan
[1] http://thread.gmane.org/gmane.comp.version-control.git/77109
[2] http://thread.gmane.org/gmane.comp.version-control.git/163979