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

[PATCH] cvsimport: catch error condition where cvs host disappears

From
MLMartin Langhoff <martin@catalyst.net.nz>
Date
Nov 2, 2005, 00:48 UTC
Message-ID
<11308925024013-git-send-email-martin@catalyst.net.nz>

Add error handling for cases where the cvs server goes away unexpectedly. While I don't know why the cvs server is so erratic, we should definitely exit here before committing bogus files.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
---
 git-cvsimport.perl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

applies-to: 5184f41aebc18fdd90c27b76b8fb230fda58fb84 2f441d6598e78b59181a084f9db5be7993971602

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index bbb83fb..e3cad5a 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -337,6 +337,10 @@ sub file {
 	}
 	close ($fh);
 
+	if ($res eq '') {
+	    die "Looks like the server has gone away while fetching $fn $rev -- exiting!";
+	}
+
 	return ($name, $res);
 }
 
---
0.99.8.GIT
Message 1 of 1 in “cvsimport: catch error condition where cvs host disappears”
  1. cvsimport: catch error condition where cvs host disappearsMartin Langhoff, Nov 2, 2005

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.