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

[PATCH] git cvsimport sanity checking

From
TMTommy M. McGuire <mcguire@crsr.net>
Date
Jun 10, 2005, 06:27 UTC
Message-ID
<20050610062747.GA4763@immutable.crsr.net>
In-Reply-To
<20050610062206.GA3992@immutable.crsr.net>

This patch adds some sanity checking to git-cvsimport-script, specifically forcing the use of cvsps -x (to get the latest information from the repository, rather than whatever is in the cache) and aborting early if cvsps does not produce any output.

I debated removing the $MODULE directory following an abort, but I eventually decided leaving stuff behind would make debugging easier. On the other hand, this patch should help with the "cvsimport left me with an empty repository" complaints.

Signed-off-by: Tommy McGuire <mcguire@crsr.net>

Call cvsps with the -x flag, to get the current state of the repository, and abort the cvs import early if cvsps does not produce any output.

--- commit 2e670826cec5642a11e2e7d6adcb48e02225ba6d tree 25e4f590772b9c0bc8ac37f8a57f4a08435ed5c6 parent 21b4b44a5deee7985f14d0f4776ad0d489092a96 author Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 01:38:42 -0500 committer Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 01:38:42 -0500

 git-cvsimport-script |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -20,6 +20,8 @@ cvsps -h 2>&1 | grep -q "cvsps version 2
 mkdir "$MODULE" || exit 1
 cd "$MODULE"
 
-TZ=UTC cvsps -A $MODULE | git-cvs2git $ARGS --cvsroot="$CVSROOT" --module="$MODULE" > .git-create-script || exit 1
+TZ=UTC cvsps -x -A $MODULE > .git-cvsps-result
+[ -s .git-cvsps-result ] || exit 1
+git-cvs2git $ARGS --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
 sh .git-create-script
 



!-------------------------------------------------------------flip-
-- 
Tommy McGuire
Previous: Tommy M. McGuireNext: Tommy M. McGuire
Message 4 of 6 in “"git cvsimport"”
  1. Linus TorvaldsJun 7, 2005
  2. Tommy M. McGuireJun 8, 2005
  3. Re: "git cvsimport"Tommy M. McGuire, Jun 10, 2005
  4. git cvsimport sanity checkingTommy M. McGuire, Jun 10, 2005
  5. cvs-migration.txtTommy M. McGuire, Jun 10, 2005
  6. git cvsimport fuzz argumentTommy M. McGuire, Jun 10, 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.