Reputation: 3209
I wrote a conversion tool from Perforce to Git. I converted my Perforce depot from change list 500000 to 800000, the most current one.
I would like to redo this conversion and start from change list 0. But this will take 3 weeks. So instead of converting 0 to 800000, I could just go to 500000 and prepend the first history block to the already existing one.
Is there any git command or approach you can think to merge two histories?
Upvotes: 1
Views: 41
Reputation: 487755
It is possible to graft Git graphs.
A grafted repository, when cloned, is un-grafted: it reverts back to two separate histories. In other words, the grafts are not transferred to clones. (After making such a clone, you can instruct it to bring over the grafts too, after which you'll have them.)
A grafted repository can be converted to a new, incompatible repository with the graft having been made permanent. To do this, use git filter-branch
with no filter. This is very slow (but probably not three-weeks-slow). (I assume the new git filter-repo
can do this as well, and it's probably faster, but that's two big unverified assumptions.)
Doing this grafting and getting it right is at least a little bit tricky. Whether to try it is up to you. If you can afford to let a conversion run for three weeks, that's definitely easier than figuring out Git's grafting, and experimenting with filter-repo or using filter-branch.
Upvotes: 2