Search code examples
gitcvs

Git cvsexportcommit and add new files


I don't know much about perl and I'm having troubles adding the functionality to git-cvsexportcommit.perl to add new files created on a git project when switching to cvs. I always get an error such as

cvs status: nothing known about `private/includes/suiviAnnuelpdf.php'
Huh? Status 'Unknown' reported for unexpected file 'no file suiviAnnuelpdf.php' 

do you have any idea?

Thanks


Solution

  • I have no idea if you found a solution but I've just been doing this and encountered a similar problem (mine was a file which I had deleted from CVS in a commit prior to a Git migration). The issue was I had not committed any changes into my Git repo so cvsexportcommit was attempting to replay the last change which was the deletion of this file. CVS complained it knew nothing about the file (too right I'd deleted it).

    For future reference this is what I've just used to send a commit into CVS from a Git repo. You will need a CVS sandbox at the ready which I'll call foo-CVS and the git repo which I'll call foo.

    cd /tmp
    cvs co -d foo-CVS foo
    git clone /my/foo.git
    cd foo
    <DO THE CHANGE on file.txt>
    git add file.txt
    git commit file.txt
    git cvsexportcommit -w ../foo-CVS -v -u HEAD
    cd ../foo-CVS
    cvs commit -F .msg file.txt
    

    The command can also do the commit for you as well but I feel better reading what changes are going into CVS for the moment until I trust the process totally.