Moving to git, need serious help

Moving to git, need serious help

by Brian Jones -
Number of replies: 7
I'm desperately trying to leave cvs behind forever, but I'm having a little bit of difficulty with the documentation I've found here --> http://docs.moodle.org/en/Tracking_Moodle_CVS_with_git

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.
brian.

Average of ratings: -
In reply to Brian Jones

Re: Moving to git, need serious help

by Martín Langhoff -

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

 cg-clone http://git.catalyst.net.nz/git/moodle-r2.git#MOODLE_18_STABLE

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.

In reply to Martín Langhoff

Re: Moving to git, need serious help

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

So if you want to track MOODLE_18_STABLE, just do

cg-clone http://git.catalyst.net.nz/git/moodle-r2.git#MOODLE_18_STABLE

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 smile), and then, from inside the moodle.git directory:

git-pull

to regularly update your local repository.

Saludos. Iñaki.

In reply to Martín Langhoff

Re: Moving to git, need serious help

by Brian Jones -
Great - thanks for all of this input, it's wonderful.

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.

Thanks again.
brian.

In reply to Brian Jones

Re: Moving to git, need serious help

by J Rogers -
Brian, have you heard anything from anyone about this? I am in the same situation as you, having custom modifications, but wanting to both upgrade and get moodle into a repository.

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.


In reply to Brian Jones

Re: Moving to git, need serious help

by Iñaki Arenaza -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
  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?

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- smile)

  1. 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 smile

Saludos. Iñaki.

In reply to Brian Jones

Re: Moving to git, need serious help

by Martín Langhoff -
Don't worry about doing the git import yourself, it'll actually mean more trouble than it's worth - just use the catalyst git repository smile