I wonder if Martin or someone could maybe revisit that doc? For example, some questions I ran into are:
1. How exactly does one get their hands on parsecvs? I can't find a download for it. Am I supposed to use git to get it? How do I do that?
2. When you say "After the initial import, you can run git-cvsimport against the SF.net repo", can you help me with the flags on this? When I tried it it said it couldn't find the CVSROOT.
3. You link to a script called 'git-clone-pack', which I don't see in my git 1.5.0 distribution. You reference it in the example as 'git clone-pack', which I'm assuming is a typo. When I got to this point I used the cg-clone command, but there's no such thing on my system at this point in the game called 'moodle.git'. Assuming I followed all of the instructions in this document, which step created that file?
I'm really feeling kind of lost right now, but I feel like there's a light ahead. I did do some reading and branching looks like it's heavenly with git.
Thanks for your help.
cg-clone -s http://www.kernel.org/pub/scm/linux/kernel/git/viro/parsecvs.git
No doubt Martin will weigh in soon with his git-fu!
Actually - I just tried this and it's not working. ML?
Hi Brian - no need to go through all that complication -- at least not to get started.
Just clone using cg from the catalyst-maintained cvs-to-git gateway. (In other words, we take care of all the git-cvsimport and parsecvs machinery).
So if you want to track MOODLE_18_STABLE, just do
That measn that you can make customisations, make local commits, etc, and keep running cg-update and it will help you merge the changes.
You can even run a small local repo and run many branches if you want, and everytime you want to grab the code updates from CVS, you can do it from our gateway. Our gateway gets updated once a day, 4am NZ time.
And it'll make sense to get your head around git and cogito a bit. There are some great guides and a nice wiki. I think http://git.or.cz/ is the jump-off point.
If you are going to use cogito, it's a bit easier. But you can use git without cogito, too. Try git-gui, qgit and gitk for graphical tools. It has gotten really good. Just make sure (if you skip cogito) to understand what "the index" is.
So if you want to track MOODLE_18_STABLE, just do
Just a little note: using the above command will let you only work with the MOODLE_18_STABLE branch, which is fine if you want exactly that.
But if you are interested in tracking HEAD and all the other stable branches with just one repository (so you can rebase your patches in newer stable versions of Moodle as they come out), you'll need to:
git-clone http://git.catalyst.net.nz/git/moodle-r2.git moodle.git
to do the initial import (this will clone the whole repository, even Catalyst's branches ), and then, from inside the moodle.git directory:
to regularly update your local repository.
What I have right now is a CVS repository that contains a modified moodle 1.6.2 that gets checked out to a test site, and then to production when testing is complete. My goal would be to move forward, keep the changes I've made to 1.6.2, but move forward using git instead of CVS.
Maybe there's another way to move forward with git in a cleaner way: I could probably code my changes to 1.8 stable fairly easily instead of doing a messy merge, but what I really need to do is keep my database, so that the production site will run 1.8 this coming fall but still contain all the data from fall '06.
I'll keep reading up on git, but in the meantime, if you guys have any tips on doing a migration of an already-hacked moodle from cvs into git and then getting that version merged with future versions, that would be fantastic. If not, then maybe it's something I can document for others to use in the future.
Either there should be documentation on how to do this, or Moodle should be smart enough to check for modifications during an upgrade and attempt to re-apply them. If neither of these options exist, it creates a significant block to users who need to upgrade a customized in-production moodle installation, and basically punishes them for modifying Moodle to meet certain requirements.
- How exactly does one get their hands on parsecvs? I can't find a download for it. Am I supposed to use git to get it? How do I do that?
parsecvs in at Keith Packard's (of X.org fame) freedesktop gitweb page. And yes, you need git to fetch it. You can get it from git://people.freedesktop.org/~keithp/parsecvs
But I wouldn't use it to import Moodle's CVS into a git repository. You need lots of RAM (and I mean lots, as it builds the whole history tree in memory), and there are a couple of places where it misses the track -somewhere at the start of the 1.6 branch-, and you end up with a wrong commit history and therefore with wrong content in that branch (I fought with this for two days, tracing and debugging the code, but I ended giving up; using Catalyst's cvs-to-git repository was easier in the end -thanks Martin L- )
- You link to a script called 'git-clone-pack', which I don't see in my git 1.5.0 distribution.
'git-clone-pack' is gone. Just use 'git-clone' and you'll be fine