Git and CVS

Git and CVS

by James Cracknell -
Number of replies: 12

Hi - I want to use CVS or GIT to keep my moodle server up to date.  I've used CVS before, but keep on reading things that GIT is replacing CVS.  If this is right what do I need to use/do to set up GIT so it downloads the latest Moodle 2.1 weekly - or do I just still use CVS? (I know how to set that up)

 

thanks

J.

Average of ratings: -
In reply to James Cracknell

Re: Git and CVS

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Git and CVS do exactly the same thing when it comes to managing source code, and the same way Moodle and, say, WebCT can be used to do online teaching. Clearly there is one you would rather be using these days.

http://docs.moodle.org/20/en/Git_for_Administrators should explain, but if you get stuck, come back to us with specific questions, then maybe we can improve the docs.

Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Git and CVS

by James Cracknell -

Hi Tim

What is lacking is a step by step guide for Windows to install and set-up GIT.  Reading the docs it just looks very complicated!

Just seen a note saying CVS is going to continue for the foreseeable future - will use it once I get my local authority to allow it to work through their firewall!  Arrrrghhhh

In reply to James Cracknell

Re: Git and CVS

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
In reply to Mary Cooch

Re: Git and CVS

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That is good, and so is http://help.github.com/win-set-up-git/.

However, one problem is that both of those tutorials are telling you how to get set up to do development using git. If you just want to use git to track the Moodle project, then you can forget about all the stuff to do with SSH keys.

One advantage of git is that for what you want to do, it can use HTTP, so you do not have to worry about firewalls.

It should be as simple as:

To install Moodle in the first place:

  1. Install msysgit (as per the tutorials)
  2. Open a command prompt and type (let us suppose you want to install Moodle in the folder C:\wwwroot\moodle):
Later, when you want to upgrade Moodle you just need to opena  command prompt and type
    • cd C:\wwwroot\moodle
    • git pull
In reply to Tim Hunt

Re: Git and CVS

by Ralf Krause -
Picture of Plugin developers Picture of Translators

Hi,

I think it should be a very good idea to make the git download easy as possible. I checked your git command on my Mac and I found that the git download is much bigger than the cvs download.

cvs download: 146,4 MB (86.333.188 Byte) for 23.068 Objects
git download: 266,1 MB (244.843.283 Byte) for 11.040 Objects

Can anybody tell me why the git download needs 266 MB? 

When I download the moodle-latest-21.zip the download file has 28 MB. The unzipped folder shows the following status in Mac OS X

zip download: 109,9 MB (88.689.572 Byte) for 11.041 Objects

As I understand the thing the cvs download needs a lot of additional very small files so we get 23.086 objects instead of 11.040 ... I don't know why the cvs download needs fewer bytes on my harddisk than the unzipped zip download smile but the git download needs many more bytes the others.

Ralf

Average of ratings:Useful (1)
In reply to Ralf Krause

Re: Git and CVS

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

There is a very simple explanation for the difference in size.

Git does not just download the latest version of Moodle. It actually downloads the entire history of the project. That is, every single version there has ever been. As you can see, it is stored in a remarkably efficient format. That entire history of every version ever has been compressed down to only one-and-a-half times the size of the latest version.

Now, if you are just interested in running the latest version of Moodle, that is just wasted disc space. On the other hand, when it comes to doing an update, you will find that you get the advantage of the very efficient compressed format, so the amount of data downloaded by git pull is very small.

The fact that git gives you the full history of the project is really brillant when you want to do development on your laptop away from wifi - and indeed in many other ways.

If you really care about disc space, you could try adding --depth = something to the git clone command. I have never tried that, but it is meant to stop it copying the full history.

Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Git and CVS

by Ralf Krause -
Picture of Plugin developers Picture of Translators

Hi Tim,

my problem is that I want to deliver Moodle4Mac with an included update tool. In my current versions I 'm using the cvs update because all needed files can be compressed into a 32 MB zip file. The moodle folder from a git update needs 184 MB in a compressed zip file.

I have to change my script so I try to deliver the moodle folder without any git archive. If the user wants to update via git he needs to downlaod 240 MB when he updates for the first time and he gets only the new files for every newer update.

Ralf

In reply to Ralf Krause

Re: Git and CVS

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you use

git clone --depth 1 -b MOODLE_21_STABLE git://github.com/moodle/moodle.git moodle

then that gives you a checkout that can later be used to pull updates, and that is 66.96 MB when zipped. Still double what you currently have.

However, there is a way to be clever. If you use

git clone --depth 1 -n -b MOODLE_21_STABLE git://github.com/moodle/moodle.git moodle

Then that creates about 42MB data, which compresses to 41.29 MB - since it is already compressed. However, if you do that, the moodle folder just not contain any files, just the hidden .git folder. You would need to arrange that when someone installs the Mac package, that it automatically runs the command

git checkout HEAD

inside the moodle folder. That will create the current check-out from the compressed representation hidden in the .git folder. That takes a few seconds.

Of course, that is only possible if the git executable is included in your installer, since I don't think you can rely on it being installed as part of MacOS, but I might be wrong.

Average of ratings:Useful (1)
In reply to Tim Hunt

Re: Git and CVS

by Kingsley Udeh -

Can someone please give me some answer(s) to these:

Can I still use CVS to inititiate an automated update in a Moodle site that is hosted externally? Or is the regular update setup only applicale to dedicated internal servers running Moodle?

Also, how does this automated Moodle update differs from Moodle Upgrade? Please help. I'm just understanding Moodle with its challenging, but interesting technologies.

 

Thank you.

 

Kingsley.

 

In reply to Kingsley Udeh

Re: Git and CVS

by Ramil Valitov -

Hi, Kingsley.

You can use CVS on any server. In a few words update is a process when only the required files are downloaded not the complete Moodle image. And of course update is an upgrade - you move from one version of Moodle to a later one.