开发者

How can I keep git cvsimport from skipping patchsets?

I'm trying to i开发者_运维问答mport a cvs module into an existing git repo. I can get it to work properly if I import into a fresh repo, but when I try to import into the existing repo it seems determined to skip all the patchsets that are dated before the last commit to the branch that I've specified with -o. This is what I'm currently trying:

git cvsimport -v -p -x -o cvs -d <cvsroot> -k -u <module>

The end of the output consists of lines like this:

skip patchset 26: 1258578534 before 1259081502

If I drop the "-o cvs", it fails with:

Branch 'origin' does not exist. 
Either use the correct '-o branch' option, 
or import to a new repository.

So, how can I get git cvsimport to import everything?


Import into a new repository, duplicate the new branch into your current repository then re-write the branch to sit after what you've already got, if that's what you're after.

Alternatively, if you're trying to replicate a multi-module CVS checkout by converting a module at a time, you may want to try to convert it all at once...

It may work to convert each module to git, pull each branch into a single repository then create a commit with each branch head as a parent, putting each module in the correct place in the tree. This doesn't do a good job of preserving concurrency in the individual modules' history.


The trick is simple:

  • Create a new git repository yourself (don't let cvsimport do this)
  • Commit an initial commit
  • Set the date of that initial commit way back in the past

Hence:

$ mkdir my_repo
$ cd my_repo
$ git init
$ touch test
$ git add test
$ git commit -m "Initial commit" --date="1990-01-01 00:00:00"

Now run git cvsimport with the -C flag pointing to your git repository folder. git cvsimport will skip patches with timestamps before the head of your branch (see -o flag).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜