Import a CVS repository into GIT results in some misleading behaviors related to timestamps
Asked Answered
M

1

11

I have used git cvsimport to import my CVS repository into a brand new GIT one.

Unfortunately, in some cases some commits have been reported in a wrong order.

E.g. I had two CVS revisions of a file, rev1.1 at 11.39am and rev1.2 at 11.42am; in GIT, I can see a commit at 11.42am (with content equal to rev1.2) and a subsequent one at 11.45am (with content equal to rev1.1).

I'm aware of the known issue stated in the cvsimport man page

If timestamps of commits in the cvs repository are not stable enough to be used for ordering commits changes may show up in the wrong order.

but I cannot understand what does stable enough mean.

Moreover, it would be great if anyone could provide me a workaround for this problem.

Thank you very much

cghersi

Monarchism answered 12/3, 2015 at 10:11 Comment(0)
C
0

Is very easy to cheat git into timestamp, as it checks only the local time, so probably the cvs checked the time into the order the tags was set.

But a workaround to this is use cherry-pick. This commands is almost a copy-paste from commits, so you can simple give a checkout to a commit from rev1.1 and there use the cherry-pick into the commit lost after the rev1.2. Than after use a rebase -i just to erase/squash the duplicated commit after the rev1.2. As using rebase/cherry-pick, the commit's tree will request a sad push -f into the branch to fix everything.

Cloche answered 7/11, 2015 at 4:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.