How to make git cvsimport checkout changes after some date?

I use git cvsimport to work with the cvs server and it works fine. However, some very old projects have many commits and large files. This causes cvsimport to spend a lot of time checking all commits and converting them to git format.

I cvsimport as follows:

 git cvsimport -v -a -d :pserver: qrtt1@localhost :/cvs cvsroot/my_module 

Can I choose a commit after a certain date?

+4
source share
2 answers

In theory, you should use the -p git cvsimport in combination with the -d cvsps option. Here are two relevant passages from the man pages:

git cvsimport:

-p <options-for-cvsps>

Additional options for cvsps. The -u and -A options are implicit and should not be used here.

If you need to pass multiple options, separate them with a comma.

cvsps:

-d <date1> -d <date2> if only one specified time is specified, show changes later than date1. If two dates are indicated, show the changes between the two dates.

Unfortunately, when I used it, cvsps complained about the date:

 $ git cvsimport -v -d <cvsroot> -p "-d '2012/01/01 00:00:00'" <module> Running cvsps... bad usage: invalid argument -d '2012/01/01 00:00:00' Usage: [...] git cvsimport: fatal: cvsps reported error 

Running cvsps itself takes a date, though, so running this as a two-step process should work.

 cvsps -d '2012/01/01 00:00:00' > patchset git cvsimport -d <cvsroot> -P patchset <module> 

You can check the output of cvsps to confirm that it has changes only after the specified date, before running the long cvsimport command.

+2
source

I think you should separate the cvsps arguments with commas:

 git cvsimport -v -d <cvsroot> -p -d,'2012/01/01 00:00:00' <module> 
+2
source

Source: https://habr.com/ru/post/1389823/


All Articles