Skip to contentSkip to conversation

cvsexportcommit/cvsimport workflow

DISCUSSION Alexander Litvinov 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

Can ypu please explain how to use cvsimport with cvsexportcommit scripts ?

I have tried these steps:
1. Make git repo from cvs repo using cvsimport command - everything works great.
2. Start traking cvs changes by incremental running cvsimport - It works.
3. Change files in git repo (master branch) - works :-)
4. Export git commits to cvs:
first question: What should be exported and in what order ? Lets skip
this part - it is the smallest problem.
Two test commits were exported to cvs without any problmes.
5. Importing cvs again - I have found my exported commits became separate commits in git repo in origin branch (solved by git-pull . origin). But thay were merged idealy.
6. Changing files again in git.
7. Export git commits to cvs: What should be exported question become harder and harder. Possible I should use some tag and run:
git-rev-list MY-TAG..master | xargs -n 1 git-cvsexportcommit -vX -cX (by the way, why just -v -c does not work ? I must add something to make options work)

This cycle is a bit of mess. I can write some scripts but I have no idea how this is supposed to work !

The biggest problem - conflict. I should resove them twice, during merging origin branch to master and when exporting these changes to cvs. By the way, I still can't export merge commit :-)

Thanks for help.
Alexander Litvinov.

#1 lore raw
Quoted 1 line · Alexander Litvinov

Can ypu please explain how to use cvsimport with cvsexportcommit scripts ?

Your approach is good -- that's exactly how I use them too. I normally use git-format-patch to review what patches I have 'pending' to be pushed upstream. It's great because it knows your last common commit, and it uses git-cherry to spot commits that are identical on both sides.

We should perhaps create git-cvsexport, followning git-format-patch's usage of git-cherry, and calling git-cvsexportcommit with them. There's been talk about doing it -- I'll probably do it as soon as I need it for a project. Feel free to have a go at it ;-)

Quoted 5 lines

7. Export git commits to cvs: What should be exported question become harder and harder. Possible I should use some tag and run:
git-rev-list MY-TAG..master | xargs -n 1 git-cvsexportcommit -vX -cX (by the way, why just -v -c does not work ? I must add something to make options work)

Strange. The getopts line should look like:

     getopts('hpvc');

(al least it does on my repo) which means that it doesn't expect parameter _values_. Have you got the same line in the script? Perhaps your getopts is broken or strange?

Quoted 2 lines

This cycle is a bit of mess. I can write some scripts but I have no idea how this is supposed to work !

Well... you have the right idea... and yes it's a bit of a mess.

Quoted 3 lines

The biggest problem - conflict. I should resove them twice, during merging origin branch to master and when exporting these changes to cvs. By the way, I still can't export merge commit :-)

That's exactly the issue. It's somewhat manual -- because you can't really automate it 100%. CVS won't know what to do with a merge, so every time you develop in paralell under git and then merge, you'll have to fudge things somehow to trick cvs. There's an impedance mismatch there.

cheers,

martin