cvs to git conversion using cvs2git ; how to resolve error "Multiple definitions of the symbol" elegantly

88 Views Asked by At

I am using cvs2git version 2.5.0. I have a old CVS repository that I am attempting to convert to a git repository. I ran the cvs2git command as below

cvs2git --blobfile=git-stage/git-blob.dat --dumpfile=git-stage/git-dump.dat --keep-cvsignore  --retain-conflicting-attic-files --encoding=ascii --encoding=utf8 --encoding=utf16 --fallback-encoding=utf8 cvsroot

This run gives me a bunch of errors as follows

enter code here
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename1,v': 1.1.1.1 1.1.1
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename1,v': 1.1.1.1 1.1.1
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename1,v': 1.1.1.1 1.1.1
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename1,v': 1.1.1.1 1.1.1
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename2,v': 1.1.1.1 1.1.1
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename3,v': 1.1.1.1 1.1.1
ERROR: Multiple definitions of the symbol 'MYSYM' in 'cvsroot/path/filename4,v': 1.1.1.1 1.1.1

I examined the files that throw this error and this is what I see at the begining of file

head     1.1;
branch   1.1.1;
access   ;
symbols  MYSYM:1.1.1.1 MYSYM:1.1.1;
locks    ; strict;
comment  @# @; ...

One option that I considered was to use --exclude option of cvs2git but I dont want to leave those files out ; there are too many of them - thousands ... Another possible workaround that I am considering resorting to is to remove one definition - by writing a crawler and sed scripting However the questions I have are

  1. is what is that duplication definition of symbol, why is it there - since it is so widespread it seems like somthing legitimate
  2. Why cant cvs2git handle it - I intriduced "-retain-conflicting-attic-files" hoping it can address this problem , but that did not help
  3. is there an solution for that

Thanks for your help

1

There are 1 best solutions below

1
On

Let me clarify - This is not exactly the answer that I am looking for . Its just a workaround that allows me to move ahead with conversion

I am posting here so it unblocks someone who is blocked like I was.

I am still looking for an elegant answer - so this "answer" isnt accepted

For my workaround, I wrote a script that loops through those thousands of cvs files 'cvsroot/path/filenamex,v' and using sed it removes the duplicate definition

for fname in  \
cvsroot/path1/path2/file1,v  \
# thousands of files \
do 
 echo "processing $fname"
    sed -i "s/mysim:1.1.1.1//g" $fname
    sed -i "s/MYSIM:1.1.1.1//g" $fname
done

Thus I removed one among the two definitions from CVS files and thereafter cvs2git could progress and complete the job