Re: git-cvs-import retries

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git-cvs-import retries

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:19

Martin Mares [off-list ref] writes:
quoted hunk
Hello!
...
This patch extends the retry check and makes the symptoms go away.
However, take it with a grain of salt as I don't understand yet why the
connection is aborted.

				Have a nice fortnight
-- 
Martin `MJ' Mares   [off-list ref]   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
A jury consists of 12 persons chosen to decide who has the better lawyer.


Signed-Off-By: Martin Mares <mj@ucw.cz>
--- old/git-cvsimport	2006-02-17 13:02:24.000000000 +0100
First, one technicality.  You can see what's wrong with the
above, right?  Remember, the top part of your message goes into
the commit log, so we do not want "Hello!" nor signature.
quoted hunk
+++ new/git-cvsimport	2006-02-17 18:13:06.000000000 +0100
@@ -371,7 +371,7 @@
 
 	$self->_file($fn,$rev) and $res = $self->_line($fh);
 
-	if (!defined $res) {
+	if (!defined $res || $res eq '') {
 	    # retry
 	    $self->conn();
 	    $self->_file($fn,$rev)
I read _line() three times but its return value is the lexical
variable $res which is initialized to 0 and then either reset to
0 by assignment or updated with $res += somethingelse.  So I do
not see how you can get a defined but empty string in there.
Even when _file() returns false, the $res variable in file()
(the function you are modifying) is not initialized, so it would
stay undefined.

Maybe I am missing something very obvious, but I cannot see how
this can make any difference.  Please enlighten.

Re: git-cvs-import retries

From: Martin Mares <mj@ucw.cz>
Date: 2016-06-15 22:42:19

Hi Junio!
First, one technicality.  You can see what's wrong with the
above, right?  Remember, the top part of your message goes into
the commit log, so we do not want "Hello!" nor signature.
Sorry about that, the patch was intended more for discussion than
for applying.
I read _line() three times but its return value is the lexical
variable $res which is initialized to 0 and then either reset to
0 by assignment or updated with $res += somethingelse.  So I do
not see how you can get a defined but empty string in there.
You almost convinced me that my fix couldn't have changed anything :-)

But it did and I finally understand why: _line() can exit not only
by return, but also by falling over when readline() returns undef.
In this case, something weird is returned (the most recent expression
evaluated) and it's *sometimes* the empty string.

I will send a new patch.

				Have a nice fortnight
-- 
Martin `MJ' Mares   [off-list ref]   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
The first myth of management is that it exists.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help