<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/test/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Poltawski</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/test/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Poltawski"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/Special:Contributions/Poltawski"/>
	<updated>2026-08-12T18:54:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Local_customisation&amp;diff=48344</id>
		<title>Development:Local customisation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Local_customisation&amp;diff=48344"/>
		<updated>2008-12-18T17:51:54Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: Added info about workaround for an install.xml file&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Disclaimer ==&lt;br /&gt;
&lt;br /&gt;
Some of these entries are things that Penny has patches for and has not yet committed, and are under discussion.  The meta bug for all these items is here:  http://tracker.moodle.org/browse/MDL-17376&lt;br /&gt;
&lt;br /&gt;
== General customisations ==&lt;br /&gt;
&lt;br /&gt;
Moodle has been designed with extensibility in mind. There are many plug-in points available though out Moodle to allow developers add new functionality to Moodle without modifying core code.&lt;br /&gt;
&lt;br /&gt;
See the [[Developer_documentation#Make_a_new_plugin|make a new plugin section of the Developer documentation page]] for the different plugin types available, and documentation on how to develop for them.&lt;br /&gt;
&lt;br /&gt;
== local/ folder for &#039;hacky&#039; customisations ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is not possible to use the available plug-in points to make your change. In situations like this then the local folder is for you. The idea is that instead of scattering your changes throughout the code base, you put them all in a folder called &#039;local&#039;. Using this folder means you won&#039;t have to deal with merging problems when you upgrade the rest of your Moodle installation.&lt;br /&gt;
&lt;br /&gt;
The local folder has some of the plug-in points available which are available to other modules. Perhaps most useful the local/db/ folder can be used to make database schema changes and custom role permissions.&lt;br /&gt;
&lt;br /&gt;
However, using the local folder should be absolutely the last resort. Long term, you will almost certainly find it easier to maintain your changes if you can package them up as one of the standard types of plugins.&lt;br /&gt;
&lt;br /&gt;
=== Local database changes and version ===&lt;br /&gt;
&lt;br /&gt;
If you need to make local database customisations that are not easily encapsulated by a block or module, Moodle does support the use of a local db upgrade script, and local version number.&lt;br /&gt;
&lt;br /&gt;
This is almost exactly the same as every other db/upgrade.php and version.php except for the following points:&lt;br /&gt;
&lt;br /&gt;
==== local/version.php ====&lt;br /&gt;
&lt;br /&gt;
local/version.php must look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$local_version = 2008121700;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== local/db/install.xml ====&lt;br /&gt;
&lt;br /&gt;
Local/ has no install.xml - only an upgrade.php.  This is because often the changes that you want to make are not full tables, but just extra columns, and a local install.xml makes less sense than just upgrade.php. &lt;br /&gt;
&lt;br /&gt;
If you would like to create tables using using an install.xml this can be achieved by putting something like that this in your upgrade.php file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$result = install_from_xmldb_file(dirname(__FILE__).&#039;/install.xml&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== local/db/upgrade.php ====&lt;br /&gt;
&lt;br /&gt;
local/db/upgrade.php must look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function xmldb_local_upgrade($oldversion) {&lt;br /&gt;
    global $CFG, $db;&lt;br /&gt;
&lt;br /&gt;
    $result = true;&lt;br /&gt;
&lt;br /&gt;
    if ($result &amp;amp;&amp;amp; $result &amp;lt; 2008121700) {&lt;br /&gt;
        $result = $result &amp;amp;&amp;amp; create_table($table);&lt;br /&gt;
    }&lt;br /&gt;
    return $result;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Local post-installation data insertion ===&lt;br /&gt;
&lt;br /&gt;
In discussion - see http://tracker.moodle.org/browse/MDL-17440&lt;br /&gt;
&lt;br /&gt;
=== Local capabilities ===&lt;br /&gt;
&lt;br /&gt;
Just like core and modules, Moodle supports the use of a db/access.php inside local/ to define local capabilities.&lt;br /&gt;
&lt;br /&gt;
The formatting is exactly the same as the other db/access.php scripts  - an array keyed by capability name, containing arrays of capability data, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$local_capabilities = array(&lt;br /&gt;
    &#039;moodle/local:capability&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;captype&#039;      =&amp;gt; &#039;write&#039;,&lt;br /&gt;
        &#039;contextlevel&#039; =&amp;gt; CONTEXT_SYSTEM,&lt;br /&gt;
        &#039;riskbitmask&#039;  =&amp;gt; RISK_SPAM,&lt;br /&gt;
    ),&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that for all local capabilities you add, you&#039;ll need to add language strings.&lt;br /&gt;
Moodle will expect to find them in local/lang/en_utf8/local.php (eg for English)&lt;br /&gt;
with a key (following the above example) of local:capability&lt;br /&gt;
&lt;br /&gt;
=== Local event subscriptions ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; Pending commit &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It is often very helpful to be able to write custom code that subscribes to normal events that Moodle throws.  It&#039;s also handy to be able to throw and catch your own custom events, as the Event API provides a very handy mechanism to do signal handling.&lt;br /&gt;
&lt;br /&gt;
Local event handlers get registered at install/upgrade time just as the event handlers for modules do.  To trigger an update when you add a new event handler, you must bump the local version number.&lt;br /&gt;
&lt;br /&gt;
Event handlers must be defined in an array, keyed by event name, with each entry in the array information about the handler, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    $handlers = array(&lt;br /&gt;
        &#039;some_core_event&#039;     =&amp;gt; array(            // eg &#039;user_created&#039;&lt;br /&gt;
            &#039;handlerfile&#039;     =&amp;gt; &#039;/local/lib.php&#039;, // example&lt;br /&gt;
            &#039;handlerfunction&#039; =&amp;gt; &#039;local_user_create_handler&#039;,&lt;br /&gt;
            &#039;schedule&#039;        =&amp;gt; &#039;cron&#039;&lt;br /&gt;
        )&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Local admin menu items and settings ===&lt;br /&gt;
&lt;br /&gt;
You can add extra configuration items to Moodle by creating a file, local/settings.php which accesses the $ADMIN variable directly and adds new items to it.  This will make them appear in the site administration block on the homepage, and create the config options that administrators can change.  You can also add whole new custom config pages (admin_externalpage).  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;root&#039;, new admin_category($name, $title);&lt;br /&gt;
$ADMIN-&amp;gt;add(&#039;foo&#039;, new admin_externalpage($name, $title, $url, $cap);&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Local backup and restore hooks ===&lt;br /&gt;
&lt;br /&gt;
In discussion - see http://tracker.moodle.org/browse/MDL-17444&lt;br /&gt;
&lt;br /&gt;
=== Local course deletion hook ===&lt;br /&gt;
&lt;br /&gt;
This is due to be removed, and replaced with an event.&lt;br /&gt;
&lt;br /&gt;
Previously, when you emptied (&#039;&#039;&#039;not deleted&#039;&#039;&#039;) a course, the notify_local_course_delete method was called, which looked for a local_delete_course method in local/lib.php.  The naming of this is a little ambiguous because the course is being emptied, not deleted.&lt;br /&gt;
&lt;br /&gt;
Going forwards, we aim to have two events - course_emptied and course_deleted.  Support for the local_delete_course method will be removed.&lt;br /&gt;
&lt;br /&gt;
See http://tracker.moodle.org/browse/MDL-17445 for more info.&lt;br /&gt;
&lt;br /&gt;
=== Local my moodle overrides ===&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;&#039;pending commit&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
By default, the My Moodle page shows a course overview in the center column.  Some sites might want to replace that with some custom code, or even just some static content.  This is very easily accomplished by:&lt;br /&gt;
&lt;br /&gt;
* Creating a local/lib.php&lt;br /&gt;
* Putting a function in there, called local_my_moodle.&lt;br /&gt;
&lt;br /&gt;
This function will be called &#039;&#039;&#039;instead of&#039;&#039; (rather than in addition to), the default center column.&lt;br /&gt;
&lt;br /&gt;
=== Local stickyblocks targets ===&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;&#039;pending commit&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
In the case where you&#039;re developing a heavily customised site, it might happen that you develop a pagetype that has the ability for people to add blocks to.  In this case, you might want to also make it stickyblock enabled.&lt;br /&gt;
&lt;br /&gt;
This is easily achieved by:&lt;br /&gt;
&lt;br /&gt;
* Create local/lib.php&lt;br /&gt;
* Create a method in there called local_get_sticky_pagetypes that returns an array just like the $pagetypes array at the top of admin/stickyblocks.php.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function local_get_sticky_pagetypes() {&lt;br /&gt;
    return array(&lt;br /&gt;
        &#039;custom_pagetype&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;id&#039; =&amp;gt; &#039;custom_pagetype&#039;,&lt;br /&gt;
            &#039;lib&#039; =&amp;gt; &#039;/local/lib.php&#039;,&lt;br /&gt;
            &#039;name&#039; =&amp;gt; get_string(&#039;custom_pagetype&#039;, &#039;local&#039;)&lt;br /&gt;
        )&lt;br /&gt;
    );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You then must create a page that extends page_base.  Don&#039;t forget that if your pagetype is stickyblock enabled, it needs to take this into account in some of its methods.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class custom_pagetype extends page_base {&lt;br /&gt;
&lt;br /&gt;
    // normal page type class&lt;br /&gt;
&lt;br /&gt;
    function url_get_path() {&lt;br /&gt;
        global $CFG;&lt;br /&gt;
        if (defined(&#039;ADMIN_STICKYBLOCKS&#039;)) { // admin is editing stickyblocks, not a normal page&lt;br /&gt;
            return $CFG-&amp;gt;wwwroot . &#039;/admin/stickyblocks.php&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        return &#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function url_get_parameters() {&lt;br /&gt;
        global $CFG;&lt;br /&gt;
        if (defined(&#039;ADMIN_STICKYBLOCKS&#039;)) {&lt;br /&gt;
            return array(&#039;pt&#039; =&amp;gt;  &#039;custom_pagetype&#039;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and map it with page_map_class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
page_map_class(&#039;custom_pagetype&#039;, &#039;custom_pagetype&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Local user profile view hook ===&lt;br /&gt;
&lt;br /&gt;
(&#039;&#039;&#039;pending commit&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Sometimes, it may be desirable to do something like add extra buttons to the bottom of the user&#039;s profile page - if you&#039;ve developed some custom code to perform extra actions on a user, for example.  This is very easy to do.&lt;br /&gt;
&lt;br /&gt;
* Create local/lib.php&lt;br /&gt;
* Create a function in there, local_user_view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function local_user_view($user, $course) {&lt;br /&gt;
&lt;br /&gt;
    // capability check&lt;br /&gt;
&lt;br /&gt;
    // extra stuff&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Local language strings ===&lt;br /&gt;
&lt;br /&gt;
The only place in the above list that requires an additional language file is the local capabilites.  These are expected to be in lang/$lang/local.php and keyed with local:capname.&lt;br /&gt;
&lt;br /&gt;
Additionally, you can of course add lang/$lang/local.php just like an extra language file and call it with the usual get_string(&#039;key&#039;, &#039;local&#039;, $a) syntax.&lt;br /&gt;
&lt;br /&gt;
There is also the ability to create a special custom lang/{$lang}_local/ directory (eg lang/en_utf8_local/), which contains just the strings that you want to override from the main language pack.  Moodle will always look there &#039;&#039;&#039;first&#039;&#039;&#039; before finding the strings in the normal language pack.&lt;br /&gt;
&lt;br /&gt;
This is because, historically, people have wanted to override some strings, typically things like &#039;course&#039; to become &#039;module&#039;, or similar, and have created custom language packs.  But then this forces the users to have this custom pack selected.  The use of {$lang}_local is much more lightweight.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[http://cvs.moodle.org/moodle/lib/locallib.php?view=markup CVS:moodle/lib/locallib.php]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=86903 Local Customisations] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Local customisation]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:How_to_apply_a_patch&amp;diff=48045</id>
		<title>Development:How to apply a patch</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:How_to_apply_a_patch&amp;diff=48045"/>
		<updated>2008-12-11T13:48:58Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Dealing with potential problems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page explains how you can apply a patch file. Patch is a standard format, and there are many options for how to apply one. Pick the one that is easiest for you.&lt;br /&gt;
&lt;br /&gt;
Perhaps most critical is the usage of the -p flag, which tells patch about the relationship between the directory where the patch file is located and the files that will be patched.  See the references below for details and DO NOT assume anything.  &lt;br /&gt;
&lt;br /&gt;
==Apply a Patch in Windows using [http://gnuwin32.sourceforge.net/packages/patch.htm gnuwin32]==&lt;br /&gt;
&lt;br /&gt;
* Download and extract patch for windows from [http://gnuwin32.sourceforge.net/packages/patch.htm sourceforge] I placed the patch.exe binary in C:\bin&lt;br /&gt;
&lt;br /&gt;
* Download and extract Moodle somewhere. eg: C:\moodle&lt;br /&gt;
&lt;br /&gt;
* Download the patch file and place it in the same directory you put Moodle (C:\moodle\password-policy-17.diff)&lt;br /&gt;
&lt;br /&gt;
* Open the patch file with Wordpad, and click &#039;File&#039; &amp;gt;&amp;gt; &#039;Save as...&#039;, choose a different name for the file eg (&#039;mynewpatch.diff&#039;) and &amp;quot;Save as type&amp;quot; &amp;gt;&amp;gt; &#039;Text Document - MS-DOS Format&#039;&lt;br /&gt;
&lt;br /&gt;
* Open up a command text window, and type:&lt;br /&gt;
&lt;br /&gt;
    cd \moodle&lt;br /&gt;
    c:\bin\patch.exe --dry-run -p1 &amp;lt; mynewpatch.diff&lt;br /&gt;
&lt;br /&gt;
:The number after &amp;lt;tt&amp;gt;&#039;-p&#039;&amp;lt;/tt&amp;gt; option can vary depending on the patch file, as it depends on the way the patch file was generated. Have a look at the [http://www.rt.com/man/patch.1.html &#039;patch&#039; utility manual page ] to see how the &amp;lt;tt&amp;gt;&#039;-p&#039;&amp;lt;/tt&amp;gt; option works. You could also have a look at this [http://www.linuxtutorialblog.com/post/introduction-using-diff-and-patch-tutorial diff and patch tutorial].&lt;br /&gt;
* You should get an output similar to this (the names and quantity of patched files vary from patch to patch):&lt;br /&gt;
&lt;br /&gt;
    patching file admin/settings/security.php&lt;br /&gt;
    patching file lang/en_utf8/admin.php&lt;br /&gt;
    patching file lib/moodlelib.php&lt;br /&gt;
    patching file login/change_password.php&lt;br /&gt;
    patching file login/signup.php&lt;br /&gt;
    patching file user/edit.php&lt;br /&gt;
    Hunk #1 succeeded at 430 (offset 2 lines).&lt;br /&gt;
&lt;br /&gt;
:At this stage the patch &amp;lt;b&amp;gt;has not been applied&amp;lt;/b&amp;gt;. We just simulated the application (with the &amp;lt;tt&amp;gt;&#039;--dry-run&#039;&amp;lt;/tt&amp;gt; option), to see if we are going to find any problems with it. Before explaining how to actually apply the patch, we are going to talk about what could be wrong, and how to deal with it.&lt;br /&gt;
&lt;br /&gt;
===Potential problems and how to deal with them===&lt;br /&gt;
====Potential problems====&lt;br /&gt;
If everything goes well, the patch will apply cleanly and life should be good! But sometimes the patch will not apply 100% cleanly due to a version mismatch between the original files used to produce the patch file and your local files. In this case, the &#039;patch&#039; command will try to apply as many changes as it can, and will emit some diagnostics describing the problems it encounters. &lt;br /&gt;
&lt;br /&gt;
* If you get any &amp;lt;tt&amp;gt;&#039;Hunk #n succeeded...&#039;&amp;lt;/tt&amp;gt; messages, the patch would have been applied correctly although at different line numbers than the original file. If we had actually applied the patch, the &#039;patch&#039; command would have created an additional file for each of the files where the hunk was applied at a different offset, that would be named like the original file with the additional extension &amp;lt;tt&amp;gt;.orig&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If you get any &amp;lt;tt&amp;gt;&#039;Hunk #n failed...&#039;&amp;lt;/tt&amp;gt; messages, the patch would have not applied correctly. In this case the &#039;patch&#039; command would have created two additional files for each of the files where the hunk was not applied correctly, called:&lt;br /&gt;
** &amp;lt;tt&amp;gt;original-file-name.orig&amp;lt;/tt&amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; This would be the original file before the patch was applied, just like above.&lt;br /&gt;
** &amp;lt;tt&amp;gt;original-file-name.rej&amp;amp;nbsp;&amp;lt;/tt&amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; This file would contain the hunks that could not be applied correctly, so you could inspect them.&lt;br /&gt;
&lt;br /&gt;
====Dealing with potential problems====&lt;br /&gt;
Dealing with the first problem (the offsetted hunks) is trivial: we just need to delete the .orig files once we actually apply the patch.&lt;br /&gt;
&lt;br /&gt;
In the second case (failed hunks), unless you know how to fix the failed hunks by hand, you &amp;lt;b&amp;gt;should not apply&amp;lt;/b&amp;gt; the patch, as that would corrupt your Moodle install. If you want to apply the patch and try to fix the failed hunks by hand, you should use the &amp;lt;tt&amp;gt;&#039;-b&#039;&amp;lt;/tt&amp;gt; option. That option automatically makes a backup of every file the patch applies to, with the &amp;lt;tt&amp;gt;.orig&amp;lt;/tt&amp;gt; extension. That would allow you go back to the original files state by simply overwritting the modified files with their &amp;lt;tt&amp;gt;.orig&amp;lt;/tt&amp;gt; backups.&lt;br /&gt;
&lt;br /&gt;
Sometimes, there will be a large difference in line numbers since a patch was generated and the patch will not apply. You can tell patch allow larger differences in line numbers by using the fuzz option &#039;-F&#039; to increase the number of lines difference there can be. For example patch -F 100 would allow 100 lines difference.&lt;br /&gt;
&lt;br /&gt;
===Actually applying the patch===&lt;br /&gt;
Now that we know what could go wrong and how to deal with it, let&#039;s see how to apply the patch. We only need to remove the &amp;lt;tt&amp;gt;&#039;--dry-run&#039;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    cd \moodle&lt;br /&gt;
    c:\bin\patch.exe -p1 &amp;lt; mynewpatch.diff&lt;br /&gt;
&lt;br /&gt;
and optionally use the &amp;lt;tt&amp;gt;&#039;-b&#039;&amp;lt;/tt&amp;gt; option if we are going to try to fix the failed hunks by hand:&lt;br /&gt;
&lt;br /&gt;
    cd \moodle&lt;br /&gt;
    c:\bin\patch.exe -b -p1 &amp;lt; mynewpatch.diff&lt;br /&gt;
&lt;br /&gt;
==Apply a Patch in Linux using &amp;quot;patch&amp;quot;==&lt;br /&gt;
use something like:&lt;br /&gt;
patch -p1 &amp;lt; patchfile.diff&lt;br /&gt;
see [http://linux.about.com/od/commands/l/blcmdl1_patch.htm here] for more details on using Patch in Linux&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Patch]]&lt;br /&gt;
* [[Development:How_to_create_a_patch]]&lt;br /&gt;
* [http://drupal.org/node/32875 Drupal - using Cygwin in Windows to apply a patch]&lt;br /&gt;
* [http://drupal.org/node/60818 Drupal - how to apply a patch in Mac OS X]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=61379#p286372 moodle post - using gnuwin32 to apply a patch]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:How_to_apply_a_patch&amp;diff=48044</id>
		<title>Development:How to apply a patch</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:How_to_apply_a_patch&amp;diff=48044"/>
		<updated>2008-12-11T13:48:34Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: quick note about the fuzz option&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
This page explains how you can apply a patch file. Patch is a standard format, and there are many options for how to apply one. Pick the one that is easiest for you.&lt;br /&gt;
&lt;br /&gt;
Perhaps most critical is the usage of the -p flag, which tells patch about the relationship between the directory where the patch file is located and the files that will be patched.  See the references below for details and DO NOT assume anything.  &lt;br /&gt;
&lt;br /&gt;
==Apply a Patch in Windows using [http://gnuwin32.sourceforge.net/packages/patch.htm gnuwin32]==&lt;br /&gt;
&lt;br /&gt;
* Download and extract patch for windows from [http://gnuwin32.sourceforge.net/packages/patch.htm sourceforge] I placed the patch.exe binary in C:\bin&lt;br /&gt;
&lt;br /&gt;
* Download and extract Moodle somewhere. eg: C:\moodle&lt;br /&gt;
&lt;br /&gt;
* Download the patch file and place it in the same directory you put Moodle (C:\moodle\password-policy-17.diff)&lt;br /&gt;
&lt;br /&gt;
* Open the patch file with Wordpad, and click &#039;File&#039; &amp;gt;&amp;gt; &#039;Save as...&#039;, choose a different name for the file eg (&#039;mynewpatch.diff&#039;) and &amp;quot;Save as type&amp;quot; &amp;gt;&amp;gt; &#039;Text Document - MS-DOS Format&#039;&lt;br /&gt;
&lt;br /&gt;
* Open up a command text window, and type:&lt;br /&gt;
&lt;br /&gt;
    cd \moodle&lt;br /&gt;
    c:\bin\patch.exe --dry-run -p1 &amp;lt; mynewpatch.diff&lt;br /&gt;
&lt;br /&gt;
:The number after &amp;lt;tt&amp;gt;&#039;-p&#039;&amp;lt;/tt&amp;gt; option can vary depending on the patch file, as it depends on the way the patch file was generated. Have a look at the [http://www.rt.com/man/patch.1.html &#039;patch&#039; utility manual page ] to see how the &amp;lt;tt&amp;gt;&#039;-p&#039;&amp;lt;/tt&amp;gt; option works. You could also have a look at this [http://www.linuxtutorialblog.com/post/introduction-using-diff-and-patch-tutorial diff and patch tutorial].&lt;br /&gt;
* You should get an output similar to this (the names and quantity of patched files vary from patch to patch):&lt;br /&gt;
&lt;br /&gt;
    patching file admin/settings/security.php&lt;br /&gt;
    patching file lang/en_utf8/admin.php&lt;br /&gt;
    patching file lib/moodlelib.php&lt;br /&gt;
    patching file login/change_password.php&lt;br /&gt;
    patching file login/signup.php&lt;br /&gt;
    patching file user/edit.php&lt;br /&gt;
    Hunk #1 succeeded at 430 (offset 2 lines).&lt;br /&gt;
&lt;br /&gt;
:At this stage the patch &amp;lt;b&amp;gt;has not been applied&amp;lt;/b&amp;gt;. We just simulated the application (with the &amp;lt;tt&amp;gt;&#039;--dry-run&#039;&amp;lt;/tt&amp;gt; option), to see if we are going to find any problems with it. Before explaining how to actually apply the patch, we are going to talk about what could be wrong, and how to deal with it.&lt;br /&gt;
&lt;br /&gt;
===Potential problems and how to deal with them===&lt;br /&gt;
====Potential problems====&lt;br /&gt;
If everything goes well, the patch will apply cleanly and life should be good! But sometimes the patch will not apply 100% cleanly due to a version mismatch between the original files used to produce the patch file and your local files. In this case, the &#039;patch&#039; command will try to apply as many changes as it can, and will emit some diagnostics describing the problems it encounters. &lt;br /&gt;
&lt;br /&gt;
* If you get any &amp;lt;tt&amp;gt;&#039;Hunk #n succeeded...&#039;&amp;lt;/tt&amp;gt; messages, the patch would have been applied correctly although at different line numbers than the original file. If we had actually applied the patch, the &#039;patch&#039; command would have created an additional file for each of the files where the hunk was applied at a different offset, that would be named like the original file with the additional extension &amp;lt;tt&amp;gt;.orig&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If you get any &amp;lt;tt&amp;gt;&#039;Hunk #n failed...&#039;&amp;lt;/tt&amp;gt; messages, the patch would have not applied correctly. In this case the &#039;patch&#039; command would have created two additional files for each of the files where the hunk was not applied correctly, called:&lt;br /&gt;
** &amp;lt;tt&amp;gt;original-file-name.orig&amp;lt;/tt&amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; This would be the original file before the patch was applied, just like above.&lt;br /&gt;
** &amp;lt;tt&amp;gt;original-file-name.rej&amp;amp;nbsp;&amp;lt;/tt&amp;gt;&amp;amp;nbsp; &amp;amp;nbsp; This file would contain the hunks that could not be applied correctly, so you could inspect them.&lt;br /&gt;
&lt;br /&gt;
====Dealing with potential problems====&lt;br /&gt;
Dealing with the first problem (the offsetted hunks) is trivial: we just need to delete the .orig files once we actually apply the patch.&lt;br /&gt;
&lt;br /&gt;
In the second case (failed hunks), unless you know how to fix the failed hunks by hand, you &amp;lt;b&amp;gt;should not apply&amp;lt;/b&amp;gt; the patch, as that would corrupt your Moodle install. If you want to apply the patch and try to fix the failed hunks by hand, you should use the &amp;lt;tt&amp;gt;&#039;-b&#039;&amp;lt;/tt&amp;gt; option. That option automatically makes a backup of every file the patch applies to, with the &amp;lt;tt&amp;gt;.orig&amp;lt;/tt&amp;gt; extension. That would allow you go back to the original files state by simply overwritting the modified files with their &amp;lt;tt&amp;gt;.orig&amp;lt;/tt&amp;gt; backups.&lt;br /&gt;
&lt;br /&gt;
Sometimes, there will be a large difference in line numbers since a patch was generated and the patch will not apply. You can tell patch allow larger differences in line numbers by using the fuzz option to increase the number of lines difference there can be. For example patch -F 100 would allow 100 lines difference.&lt;br /&gt;
&lt;br /&gt;
===Actually applying the patch===&lt;br /&gt;
Now that we know what could go wrong and how to deal with it, let&#039;s see how to apply the patch. We only need to remove the &amp;lt;tt&amp;gt;&#039;--dry-run&#039;&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
    cd \moodle&lt;br /&gt;
    c:\bin\patch.exe -p1 &amp;lt; mynewpatch.diff&lt;br /&gt;
&lt;br /&gt;
and optionally use the &amp;lt;tt&amp;gt;&#039;-b&#039;&amp;lt;/tt&amp;gt; option if we are going to try to fix the failed hunks by hand:&lt;br /&gt;
&lt;br /&gt;
    cd \moodle&lt;br /&gt;
    c:\bin\patch.exe -b -p1 &amp;lt; mynewpatch.diff&lt;br /&gt;
&lt;br /&gt;
==Apply a Patch in Linux using &amp;quot;patch&amp;quot;==&lt;br /&gt;
use something like:&lt;br /&gt;
patch -p1 &amp;lt; patchfile.diff&lt;br /&gt;
see [http://linux.about.com/od/commands/l/blcmdl1_patch.htm here] for more details on using Patch in Linux&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Patch]]&lt;br /&gt;
* [[Development:How_to_create_a_patch]]&lt;br /&gt;
* [http://drupal.org/node/32875 Drupal - using Cygwin in Windows to apply a patch]&lt;br /&gt;
* [http://drupal.org/node/60818 Drupal - how to apply a patch in Mac OS X]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=61379#p286372 moodle post - using gnuwin32 to apply a patch]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Enrolment_plugins_2.0&amp;diff=47226</id>
		<title>Development:Enrolment plugins 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Enrolment_plugins_2.0&amp;diff=47226"/>
		<updated>2008-11-26T11:45:05Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added a &amp;#039;global groups&amp;#039; use case&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
The enrolment plugin system in Moodle has evolved over a long period spanning the time before and after the configurable roles system was introduced in Moodle 1.7. Despite the evolution, it is showing its age and it is probably time for a more fundamental rethink.&lt;br /&gt;
&lt;br /&gt;
This page is a tool to help that thinking. There is no guarantee that anything will happen for Moodle 2.0. There are plenty of other things on the roadmap with higher priority.&lt;br /&gt;
&lt;br /&gt;
==Use cases==&lt;br /&gt;
&lt;br /&gt;
# [Conceptual] In all sorts of places, we need to distinguish people who can get into the course and look around (guests, admins, inspectors, ...) from people who are actually participants in the course (students and teachers).&lt;br /&gt;
# [Conceptual] We need to distinguish users in the course who appear in the gradebook, or whose results appear in the quiz reports.&lt;br /&gt;
# Teacher wants each student to pay $1000 through some billing system before they can join a course.&lt;br /&gt;
# Teacher wants student to enter a password before they can join a course, and depending which password they enter, they may get put in different groups.&lt;br /&gt;
# Teacher wants to allow students to self-register for a course, but only within a certain time period.&lt;br /&gt;
# Teacher wants students to self-register in Calculus 201, but only if they have completed Maths 101.&lt;br /&gt;
# Teacher wants to remove student&#039;s access at the end of the course, but still wants to be able to go back later and look at the gradebook data.&lt;br /&gt;
# Teacher wants a manual way to to unenrol a user, even if they have self-registered, and prevent them re-registering.&lt;br /&gt;
# If the teacher mis-clicks and unenrols the wrong user, they want to be able to immediately re-enrol them, without any data being lost.&lt;br /&gt;
# Teacher wants a way to automatically unenrol users who do not actively participate for 30 days.&lt;br /&gt;
# Admin wants to automatically synchronise enrolments with some external database or application. (While still having some manually created role assignments in the system.)&lt;br /&gt;
# Admin does not want teachers to be able to unenrol students that have been added by the synchronise plugins, but does want them to be able to remove students they have added manually.&lt;br /&gt;
# Metacourses - automatically enroling in one course should enrol you in a parent course - do we need to keep this working the way it does now? or would an alternative solution be acceptable?&lt;br /&gt;
# Admin wants anyone who is a teacher in any course to automatically get a special role at site level, so teachers in any course can get some site-level capabilities.&lt;br /&gt;
# When backing up and restoring a course, need some control which enrolments are included. (Need specific details.)&lt;br /&gt;
# Information about enrolment must automatically appear in course listings (but only to unenroled users?) (Do we really need this automatically generated, can&#039;t teachers put whatever they like in the coures description?)&lt;br /&gt;
# [Technical] When analysing data to generate reports like this, we need to be able to do a simple join in SQL to work out which users should be included in the report.&lt;br /&gt;
# [Technical] Data specific to certain enrolment methods (e.g. price, password) should not be stored in the course table.&lt;br /&gt;
# [Technical] Some of this need to be configured at the site level, others at course level. (And would we ever want things to happen at category or activity level? What about automatic enrolment of parents?)&lt;br /&gt;
# [Technical] Whether guests or logged in users are allowed into a course as guests should really only be a matter of setting overrides on the respective role. This should not be stored separately (irrespective of what the interface for setting these options are).&lt;br /&gt;
# [Technical] Configuring enrolment options for your course will either by on the course settings page, or on a separate tab next to Course settings and Assign roles.&lt;br /&gt;
# Teacher wants to assign a &#039;group of students&#039; at a time (this group would exist at global context and might be populated automatically by an external system)&lt;br /&gt;
(Any role mentioned in the above text is mentioned informally, by way of motivating the feature. In the actual system,  each feature should work with any role.)&lt;br /&gt;
&lt;br /&gt;
==Overview of the solution==&lt;br /&gt;
&lt;br /&gt;
My (Tim&#039;s) proposed solution would be this (in fact, I don&#039;t think it is a very big change from what we have now):&lt;br /&gt;
&lt;br /&gt;
* The current state of who is enrolled in which course is stored indirectly via role assignments (as at present).&lt;br /&gt;
&lt;br /&gt;
* A user is deemed to be a participant in a course if they have the (new) capability moodle/course:participate in that course context. If a user does not have this capability, then they may still be allowed into the course if they have the (existing) moodle/course:view capability. By default, Student, Teacher and Non-editing teachers would have the participate capability. Admin, Course creator and Guest? would get course:view.&lt;br /&gt;
&lt;br /&gt;
* A user would appear in the gradebook if they have the (new) capability moodle/course:begraded. By default, only Students would have this capability.&lt;br /&gt;
&lt;br /&gt;
* Enrolment plugins are just ways of creating (or deleting) role assignments, and hence letting people into courses.&lt;br /&gt;
&lt;br /&gt;
* There should be hooks, when a user tries to get into a course they are not a participant of, for enrolment plugins to either let the user in silently by creating a role assignment, or by displaying some UI (like ask for a password or cash), or giving the option to go in as a guest.&lt;br /&gt;
&lt;br /&gt;
* Alternatively, or as well, enrolment plugins can do things on cron, or when triggered by the events API.&lt;br /&gt;
&lt;br /&gt;
* Enrolment plugins will have site-wide configuration, so administrators can control which plugins are active for the site, and set their options.&lt;br /&gt;
&lt;br /&gt;
* Enrolment plugins will also have course-specific configuration, to control which plugin(s) apply to that course, and set any per-course options.&lt;br /&gt;
&lt;br /&gt;
* To help with reporting and performance, we will make a new table course_participants_cache with columns id, contextid, userid, isparticipant, isgraded. That caches, for each context, or perhaps just each course context and each user, the results of has_capability for the two capabilities moodle/course:participate and moodle/course:begraded (A row will only be included if either isparticipant or isgraded is true.) This is automatically kept up to date whenever roles information changes. (Should that be contextid or courseid?).&lt;br /&gt;
&lt;br /&gt;
* Extra information will be displayed on the manual Assign roles page and in the Participants list, so you can see which enrolment plugin was responsible for enrolling each student, and information about timed enrolments. (So, for example, you don&#039;t end up unenrolling a student who has paid a lot of money to enrol themselves.)&lt;br /&gt;
&lt;br /&gt;
==Detailed design==&lt;br /&gt;
&lt;br /&gt;
Will only be done later, if we get agreement on the use cases and solution overview.&lt;br /&gt;
&lt;br /&gt;
==List of related tracker issues==&lt;br /&gt;
&lt;br /&gt;
Petr offered to make a list, to help us ensure that we have considered all the things that caused problems in the past.&lt;br /&gt;
&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Roadmap|Moodle 2.0 roadmap]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Enrolment]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Developer_meeting_November_2008&amp;diff=46630</id>
		<title>Developer meeting November 2008</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Developer_meeting_November_2008&amp;diff=46630"/>
		<updated>2008-11-12T12:19:32Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added gsoc mentor summit item&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Developer meetings]] &amp;gt; November 2008 meeting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Date: 23:00 UTC on Monday, 24 November 2008 - see the [http://moodle.org/calendar/view.php?view=day&amp;amp;course=5&amp;amp;cal_d=25&amp;amp;cal_m=11&amp;amp;cal_y=2008#event_4805 Moodle Developer Meeting calendar entry] for conversion into your time zone &lt;br /&gt;
*Location: [http://elluminate.remote-learner.net/join_meeting.html?meetingId=1176914355734 Elluminate Moodle Developers Meeting Room] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome, though [http://moodle.org/mod/cvsadmin/view.php?id=7134 developers with CVS write access] will be given preference if the room becomes full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please add items to the agenda!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Moodle 2.0==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Enrolment_plugins_2.0|Enrolment plugins proposal]]&lt;br /&gt;
* [[Development:Web_services|New web services system]]&lt;br /&gt;
* [[Development:Roles_administration_improvements_for_Moodle_2.0|New roles interfaces demo]], as an example of good JavaScript practices&lt;br /&gt;
&lt;br /&gt;
==Other news==&lt;br /&gt;
&lt;br /&gt;
*Google Highly Open Participation Contest (GHOP) (Helen)&lt;br /&gt;
*GSOC Mentor Summit - a few words about the summit (DanP &amp;amp; maybe Anthony/David Horat if they have anything to add)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44690</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44690"/>
		<updated>2008-10-02T12:58:23Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added work in progress note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
== Thorough Resolved Bug QA review with git ==&lt;br /&gt;
&lt;br /&gt;
The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.&lt;br /&gt;
&lt;br /&gt;
Please note this workflow might not be ideal for all scenarios (for example if lots of work has been done in the same area since).&lt;br /&gt;
&lt;br /&gt;
Example Workflow to QA MDL-16600:&lt;br /&gt;
&lt;br /&gt;
First checkout a new branch for us to work on testing the bug in MOODLE_19_STABLE. We can delete this branch later, its less dangerous than playing any of our &#039;live&#039; branches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git checkout -b QA-MDL-16600 origin/MOODLE_19_STABLE&lt;br /&gt;
Branch QA-MDL-16600 set up to track remote branch refs/remotes/origin/MOODLE_19_STABLE.&lt;br /&gt;
Switched to a new branch &amp;quot;QA-MDL-16600&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now search for any commits related to this bug fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$  git log --grep=&#039;MDL-16600&#039;&lt;br /&gt;
commit 1c2c8b09469ac27a3829e7267f399356a05b9810&lt;br /&gt;
Author: tjhunt &amp;lt;tjhunt&amp;gt;&lt;br /&gt;
Date:   Fri Sep 26 05:49:06 2008 +0000&lt;br /&gt;
&lt;br /&gt;
    MDL-16600 forcedownload broken for file resources.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to test that these commits fixed the bug, we will revert this commit, and then try to reproduce the reported bug:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git revert -n 1c2c8b09469ac27a3829e7267f399356a05b9810 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we&#039;ve reproduced the problem, we will reset our repository back to HEAD:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now if the bug is fixed, it can be closed and we can delete our branch:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch -D QA-MDL-16600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(Please add your own tips here!)&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[Using GIT to backup moodledata]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Git tips]]&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44687</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44687"/>
		<updated>2008-10-02T12:48:07Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added devloper tools category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to. This initial clone will take some time, but note that once you have cloned this repository, you will have the complete moodle source code history locally and can easily browse and checkout any commit in moodle history without a network connection.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
To get updated from cvs/catalyst&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git fetch # fetches changes from upstream repostiroy&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE # merges changes from upstream&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~/src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Git Tips==&lt;br /&gt;
See [[Development:Git tips]] for git tips to help you with moodle development.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44686</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44686"/>
		<updated>2008-10-02T12:47:19Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: developer tools category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
== Thorough Resolved Bug QA review with git ==&lt;br /&gt;
&lt;br /&gt;
The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.&lt;br /&gt;
&lt;br /&gt;
Please note this workflow might not be ideal for all scenarios (for example if lots of work has been done in the same area since).&lt;br /&gt;
&lt;br /&gt;
Example Workflow to QA MDL-16600:&lt;br /&gt;
&lt;br /&gt;
First checkout a new branch for us to work on testing the bug in MOODLE_19_STABLE. We can delete this branch later, its less dangerous than playing any of our &#039;live&#039; branches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git checkout -b QA-MDL-16600 origin/MOODLE_19_STABLE&lt;br /&gt;
Branch QA-MDL-16600 set up to track remote branch refs/remotes/origin/MOODLE_19_STABLE.&lt;br /&gt;
Switched to a new branch &amp;quot;QA-MDL-16600&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now search for any commits related to this bug fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$  git log --grep=&#039;MDL-16600&#039;&lt;br /&gt;
commit 1c2c8b09469ac27a3829e7267f399356a05b9810&lt;br /&gt;
Author: tjhunt &amp;lt;tjhunt&amp;gt;&lt;br /&gt;
Date:   Fri Sep 26 05:49:06 2008 +0000&lt;br /&gt;
&lt;br /&gt;
    MDL-16600 forcedownload broken for file resources.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to test that these commits fixed the bug, we will revert this commit, and then try to reproduce the reported bug:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git revert -n 1c2c8b09469ac27a3829e7267f399356a05b9810 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we&#039;ve reproduced the problem, we will reset our repository back to HEAD:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now if the bug is fixed, it can be closed and we can delete our branch:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch -D QA-MDL-16600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[Using GIT to backup moodledata]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Git tips]]&lt;br /&gt;
[[Category:Developer tools]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44685</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44685"/>
		<updated>2008-10-02T12:31:52Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added seelaso&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
== Thorough Resolved Bug QA review with git ==&lt;br /&gt;
&lt;br /&gt;
The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.&lt;br /&gt;
&lt;br /&gt;
Please note this workflow might not be ideal for all scenarios (for example if lots of work has been done in the same area since).&lt;br /&gt;
&lt;br /&gt;
Example Workflow to QA MDL-16600:&lt;br /&gt;
&lt;br /&gt;
First checkout a new branch for us to work on testing the bug in MOODLE_19_STABLE. We can delete this branch later, its less dangerous than playing any of our &#039;live&#039; branches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git checkout -b QA-MDL-16600 origin/MOODLE_19_STABLE&lt;br /&gt;
Branch QA-MDL-16600 set up to track remote branch refs/remotes/origin/MOODLE_19_STABLE.&lt;br /&gt;
Switched to a new branch &amp;quot;QA-MDL-16600&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now search for any commits related to this bug fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$  git log --grep=&#039;MDL-16600&#039;&lt;br /&gt;
commit 1c2c8b09469ac27a3829e7267f399356a05b9810&lt;br /&gt;
Author: tjhunt &amp;lt;tjhunt&amp;gt;&lt;br /&gt;
Date:   Fri Sep 26 05:49:06 2008 +0000&lt;br /&gt;
&lt;br /&gt;
    MDL-16600 forcedownload broken for file resources.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to test that these commits fixed the bug, we will revert this commit, and then try to reproduce the reported bug:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git revert -n 1c2c8b09469ac27a3829e7267f399356a05b9810 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we&#039;ve reproduced the problem, we will reset our repository back to HEAD:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now if the bug is fixed, it can be closed and we can delete our branch:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch -D QA-MDL-16600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[Using GIT to backup moodledata]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Git tips]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44682</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44682"/>
		<updated>2008-10-02T12:09:17Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: info about deleting branch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
== Thorough Resolved Bug QA review with git ==&lt;br /&gt;
&lt;br /&gt;
The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.&lt;br /&gt;
&lt;br /&gt;
Please note this workflow might not be ideal for all scenarios (for example if lots of work has been done in the same area since).&lt;br /&gt;
&lt;br /&gt;
Example Workflow to QA MDL-16600:&lt;br /&gt;
&lt;br /&gt;
First checkout a new branch for us to work on testing the bug in MOODLE_19_STABLE. We can delete this branch later, its less dangerous than playing any of our &#039;live&#039; branches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git checkout -b QA-MDL-16600 origin/MOODLE_19_STABLE&lt;br /&gt;
Branch QA-MDL-16600 set up to track remote branch refs/remotes/origin/MOODLE_19_STABLE.&lt;br /&gt;
Switched to a new branch &amp;quot;QA-MDL-16600&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now search for any commits related to this bug fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$  git log --grep=&#039;MDL-16600&#039;&lt;br /&gt;
commit 1c2c8b09469ac27a3829e7267f399356a05b9810&lt;br /&gt;
Author: tjhunt &amp;lt;tjhunt&amp;gt;&lt;br /&gt;
Date:   Fri Sep 26 05:49:06 2008 +0000&lt;br /&gt;
&lt;br /&gt;
    MDL-16600 forcedownload broken for file resources.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to test that these commits fixed the bug, we will revert this commit, and then try to reproduce the reported bug:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git revert -n 1c2c8b09469ac27a3829e7267f399356a05b9810 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we&#039;ve reproduced the problem, we will reset our repository back to HEAD:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now if the bug is fixed, it can be closed and we can delete our branch:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git branch -D QA-MDL-16600&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Git tips]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44681</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44681"/>
		<updated>2008-10-02T11:59:44Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added a tip which allows QA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
== Thorough Resolved Bug QA review with git ==&lt;br /&gt;
&lt;br /&gt;
The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.&lt;br /&gt;
&lt;br /&gt;
Please note this workflow might not be ideal for all scenarios (for example if lots of work has been done in the same area since).&lt;br /&gt;
&lt;br /&gt;
Example Workflow to QA MDL-16600:&lt;br /&gt;
&lt;br /&gt;
First checkout a new branch for us to work on testing the bug in MOODLE_19_STABLE. We can delete this branch later, its less dangerous than playing any of our &#039;live&#039; branches.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git checkout -b QA-MDL-16600 origin/MOODLE_19_STABLE&lt;br /&gt;
Branch QA-MDL-16600 set up to track remote branch refs/remotes/origin/MOODLE_19_STABLE.&lt;br /&gt;
Switched to a new branch &amp;quot;QA-MDL-16600&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now search for any commits related to this bug fix:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$  git log --grep=&#039;MDL-16600&#039;&lt;br /&gt;
commit 1c2c8b09469ac27a3829e7267f399356a05b9810&lt;br /&gt;
Author: tjhunt &amp;lt;tjhunt&amp;gt;&lt;br /&gt;
Date:   Fri Sep 26 05:49:06 2008 +0000&lt;br /&gt;
&lt;br /&gt;
    MDL-16600 forcedownload broken for file resources.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to test that these commits fixed the bug, we will revert this commit, and then try to reproduce the reported bug:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git revert -n 1c2c8b09469ac27a3829e7267f399356a05b9810 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we&#039;ve reproduced the problem, we will reset our repository back to HEAD:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
git reset --hard HEAD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now if the bug is fixed, it can be closed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Git tips]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44680</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44680"/>
		<updated>2008-10-02T11:29:38Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: updated cateogory&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
== Streamlining Resolved Bug QA review with git ==&lt;br /&gt;
&lt;br /&gt;
The power of having fast access to all of moodle commit history means we can search and checkout any point in moodle source code history which allows us to powerfully QA a bug.&lt;br /&gt;
&lt;br /&gt;
Example Workflow to QA &lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Git tips]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44679</id>
		<title>Development:Git tips</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Git_tips&amp;diff=44679"/>
		<updated>2008-10-02T11:21:45Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: Adding new git tips page to share workflows and useful tips&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Many developers find git a useful tool to help them with moodle development, here some tips and workflows can be shared to help others.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44678</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44678"/>
		<updated>2008-10-02T11:19:26Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: fix missing link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to. This initial clone will take some time, but note that once you have cloned this repository, you will have the complete moodle source code history locally and can easily browse and checkout any commit in moodle history without a network connection.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
To get updated from cvs/catalyst&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git fetch # fetches changes from upstream repostiroy&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE # merges changes from upstream&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~/src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Git Tips==&lt;br /&gt;
See [[Development:Git tips]] for git tips to help you with moodle development.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44677</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44677"/>
		<updated>2008-10-02T11:19:08Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to. This initial clone will take some time, but note that once you have cloned this repository, you will have the complete moodle source code history locally and can easily browse and checkout any commit in moodle history without a network connection.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
To get updated from cvs/catalyst&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git fetch # fetches changes from upstream repostiroy&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE # merges changes from upstream&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~/src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Git Tips==&lt;br /&gt;
See [Development:Git tips] for git tips to help you with moodle development.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44675</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44675"/>
		<updated>2008-10-02T11:10:07Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Using git effectively with Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to. This initial clone will take some time, but note that once you have cloned this repository, you will have the complete moodle source code history locally and can easily browse and checkout any commit in moodle history without a network connection.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
To get updated from cvs/catalyst&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git fetch # fetches changes from upstream repostiroy&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE # merges changes from upstream&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~/src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44674</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44674"/>
		<updated>2008-10-02T11:06:09Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Using git effectively with Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to. This initial clone will take some time, but note that once you have cloned this repository, you will have the complete moodle source code history locally and can easily browse and checkout any commit in moodle history without a network connection.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~/src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44673</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44673"/>
		<updated>2008-10-02T11:00:05Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added info about the time of initial clone&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to. This initial clone will take some time, but note that once you have cloned this repository, you will have the complete moodle source code history locally and can easily browse and checkout any commit in moodle history without a network connection.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44672</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44672"/>
		<updated>2008-10-02T10:51:20Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Obtaining git */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://git.or.cz/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
&lt;br /&gt;
You might also find the additional git porcelain (frontend) useful:&lt;br /&gt;
* [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
* [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing very quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to.  You can then get updates from the catalyst git repository that can be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44671</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44671"/>
		<updated>2008-10-02T10:48:35Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Using git effectively with Moodle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to.  You can then get updates from the catalyst git repository that can be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle origin/MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge origin/MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git clone ~src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44670</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44670"/>
		<updated>2008-10-02T10:46:21Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Helpful Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to.  You can then get updates from the catalyst git repository that can be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone ~src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Importing_Moodle_CVS_history_into_git&amp;diff=44669</id>
		<title>Development:Importing Moodle CVS history into git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Importing_Moodle_CVS_history_into_git&amp;diff=44669"/>
		<updated>2008-10-02T10:46:13Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
== Useful Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Importing Moodle CVS history into git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44668</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44668"/>
		<updated>2008-10-02T10:45:21Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Creating a Working Copy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory is ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to.  You can then get updates from the catalyst git repository that can be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone ~src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44667</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44667"/>
		<updated>2008-10-02T10:42:57Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: updated example directory&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to.  You can then get updates from the catalyst git repository that can be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd ~/src/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone ~src/moodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44666</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44666"/>
		<updated>2008-10-02T10:41:00Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: updating example to use catalyst repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was ~/src/moodle)&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.catalyst.net.nz/moodle-r2.git ~/src/moodle&lt;br /&gt;
&lt;br /&gt;
This will clone the catalyst moodle git repostitory into a local working copy that you may make changes to and commit to.  You can then get updates from the catalyst git repository that can be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44665</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44665"/>
		<updated>2008-10-02T10:33:39Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: note about catalyst repo (going to post on the forums to confirm this is ok later!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
It is &#039;&#039;&#039;highly advisable&#039;&#039;&#039; to clone the Catalyst git repository as this is updated hourly and the imported CVS history will share common commit hashes allowing developers to merge each others changes easily.&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44662</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44662"/>
		<updated>2008-10-02T10:19:51Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added gitweb link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at [http://git.catalyst.net.nz/gw?p=moodle-r2.git;a=summary git://git.catalyst.net.nz/moodle-r2.git]&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44661</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44661"/>
		<updated>2008-10-02T10:19:19Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: removing git-cvsimport reference for this page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at git://git.catalyst.net.nz/moodle-r2.git&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Importing_Moodle_CVS_history_into_git&amp;diff=44660</id>
		<title>Development:Importing Moodle CVS history into git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Importing_Moodle_CVS_history_into_git&amp;diff=44660"/>
		<updated>2008-10-02T10:16:56Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Importing Moodle CVS history into git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44659</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44659"/>
		<updated>2008-10-02T10:16:04Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Downloading Moodle CVS History for git */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at git://git.catalyst.net.nz/moodle-r2.git&lt;br /&gt;
* Run a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44658</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44658"/>
		<updated>2008-10-02T10:15:43Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: I have split the cvs import section into [Development:Importing Moodle CVS history into git] . Accepted wisdom seems to be that we should just all use the catalyst repo these days ;)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
== Downloading Moodle CVS History for git ==&lt;br /&gt;
&lt;br /&gt;
There are currently two methods of retrieving Moodle CVS history for git:&lt;br /&gt;
* Clone the [http://www.catalyst.net.nz Catalyst IT] git import found at git://git.catalyst.net.nz/moodle-r2.git&lt;br /&gt;
* Run your a local cvs import into git. ( Instructions for this can be found in [[Development:Importing Moodle CVS history into git]] )&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Importing_Moodle_CVS_history_into_git&amp;diff=44652</id>
		<title>Development:Importing Moodle CVS history into git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Importing_Moodle_CVS_history_into_git&amp;diff=44652"/>
		<updated>2008-10-02T09:59:29Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: Moved this content from existing page: Development:Tracking Moodle CVS with git&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44639</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44639"/>
		<updated>2008-10-01T22:38:12Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: remove note about cogito, git 1.5.3 offers good interface&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.5.3 in mind.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44638</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44638"/>
		<updated>2008-10-01T22:22:07Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: Removed obsolete cogito docs + broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.4 and Cogito v0.17 in mind. Ubuntu and Debian Backports have up-to-date packages for GIT, Cogito and related packages. RPMs are usually also available via YUM. If you want to be on the bleeding/leading edge you can follow the &#039;&#039;maint&#039;&#039; or &#039;&#039;master&#039;&#039; branches of the GIT development code.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44637</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44637"/>
		<updated>2008-10-01T22:15:30Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: removed cogito commands - not sure about the new client install method&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.4 and Cogito v0.17 in mind. Ubuntu and Debian Backports have up-to-date packages for GIT, Cogito and related packages. RPMs are usually also available via YUM. If you want to be on the bleeding/leading edge you can follow the &#039;&#039;maint&#039;&#039; or &#039;&#039;master&#039;&#039; branches of the GIT development code.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 git add  .&lt;br /&gt;
 git status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 git commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 git merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you could use:&lt;br /&gt;
&lt;br /&gt;
 git-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
 cd /home/someclient/public_html/&lt;br /&gt;
 git checkout mymoodle origin/mymoodle&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://wellington.pm.org/archive/200510/git/ cogito tutorial by martin langhoff]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/tutorial.html git tutorial]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/cogito/docs/ cogito man pages]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development_talk:Tracking_Moodle_CVS_with_git&amp;diff=44635</id>
		<title>Development talk:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development_talk:Tracking_Moodle_CVS_with_git&amp;diff=44635"/>
		<updated>2008-10-01T22:04:13Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: New page: I am currently doing a bit of an overhaul of this page to remove obsolete coigto stuff - dont really see a reason why anyone would use it or want docs for it.--~~~~&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I am currently doing a bit of an overhaul of this page to remove obsolete coigto stuff - dont really see a reason why anyone would use it or want docs for it.--[[User:Dan Poltawski|Dan Poltawski]] 17:04, 1 October 2008 (CDT)&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44634</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44634"/>
		<updated>2008-10-01T22:03:14Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: removed cogito commands - cogito is obsolete, and the git interface is quite friendly now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.4 and Cogito v0.17 in mind. Ubuntu and Debian Backports have up-to-date packages for GIT, Cogito and related packages. RPMs are usually also available via YUM. If you want to be on the bleeding/leading edge you can follow the &#039;&#039;maint&#039;&#039; or &#039;&#039;master&#039;&#039; branches of the GIT development code.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 cg-add -r .&lt;br /&gt;
 cg-status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 cg-commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 cg-merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you would use:&lt;br /&gt;
&lt;br /&gt;
 cg-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://wellington.pm.org/archive/200510/git/ cogito tutorial by martin langhoff]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/tutorial.html git tutorial]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/cogito/docs/ cogito man pages]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44633</id>
		<title>Development:Tracking Moodle CVS with git</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Tracking_Moodle_CVS_with_git&amp;diff=44633"/>
		<updated>2008-10-01T21:58:59Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: removed obsolete information about windows - replaced with note about packaged binaries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note: Work in progress. These are notes for users that are comfortable with CVS and other SCMs, doing branching, merging, etc.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
If you plan on doing complicated or sustained development on Moodle, you will benefit from a local revision control system. Centralized systems like [http://www.nongnu.org/cvs/ CVS] and [http://subversion.tigris.org/ SVN] have limited capabilities for tracking vendor branches. For the ultimate experience you will want to use a system with distributed capabilities like [http://git.or.cz/ git]. Alternative tools for this include [http://www.selenic.com/mercurial/ Mercurial], [http://www.darcs.net/ Darcs] and [http://svk.elixus.org/ SVK].&lt;br /&gt;
&lt;br /&gt;
GIT was developed by Linus Torvalds specifically for the Linux Kernel team. It is fast, fast, fast. Its usage is slightly different from CVS/SVN, but, if kernel developers can handle it &#039;&#039;Moodle developers will find it &#039;&#039;&#039;easy&#039;&#039;&#039; &#039;&#039; ;-)&lt;br /&gt;
&lt;br /&gt;
Git is packaged for most major operating systems and an up to date list of packages can be found on [http://git.or.cz/ git.or.gz].&lt;br /&gt;
&lt;br /&gt;
==Obtaining git==&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want:&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/ Git] (and its deps). It includes &#039;&#039;&#039;gitk&#039;&#039;&#039;, a very good UI for visualising project history.&lt;br /&gt;
* [http://www.cobite.com/cvsps/ cvsps] (a dependency of git-cvsimport make sure you have the latest release)&lt;br /&gt;
* an additional git porcelain (frontend)&lt;br /&gt;
** [http://sourceforge.net/projects/qgit qgit] a nice GUI to view the project history, make commits, etc. Recommended! Note: qgit is tricky to compile by hand, get a .deb or an .rpm&lt;br /&gt;
** [http://www.procode.org/stgit/ stgit] (StackedGIT is mainly for users doing heavy cherry picking. Only recommended for very advanced SCM users.)&lt;br /&gt;
&lt;br /&gt;
Git is still developing quickly, but good mature versions are already available in packaged format. This guide is written with GIT v1.4 and Cogito v0.17 in mind. Ubuntu and Debian Backports have up-to-date packages for GIT, Cogito and related packages. RPMs are usually also available via YUM. If you want to be on the bleeding/leading edge you can follow the &#039;&#039;maint&#039;&#039; or &#039;&#039;master&#039;&#039; branches of the GIT development code.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS==&lt;br /&gt;
&lt;br /&gt;
To begin we must import the CVS repository into a local git filesystem using [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport].&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 CVSROOT=:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
 MODULE=moodle&lt;br /&gt;
 INSTALLDIR=moodle&lt;br /&gt;
 git-cvsimport -p x -v -k -o cvshead -d $CVSROOT -C $INSTALLDIR $MODULE &amp;amp;&amp;gt; cvsimport.log&lt;br /&gt;
&lt;br /&gt;
(When might one want to use the -m -u and -s flags?)&lt;br /&gt;
 -u purely cosmetic&lt;br /&gt;
 -s slashes can cause problems but this doesn&#039;t seem to be the case with moodle&lt;br /&gt;
 -m ?&lt;br /&gt;
&lt;br /&gt;
This will run for a &#039;&#039;&#039;very&#039;&#039;&#039; long time as it checks out every revision of each file (including all branches).  However, if you run the command after a successful initial run it will simply get the new revisions since it was last run.  This creates a new git repository which can then be cloned and worked upon. &lt;br /&gt;
&lt;br /&gt;
At the time of writing the size of a new Moodle git repository was approximately 866MB &#039;&#039;unpacked&#039;&#039;, and 75MB packed. Newer versions of git pack the project during import, so your resulting repository plus checkout should be a bit over 100MB. Still, it is a good idea to pack the repository to make it smaller and faster, running &lt;br /&gt;
&lt;br /&gt;
 git-repack -a -d &lt;br /&gt;
&lt;br /&gt;
With the -o cvshead flag, the &amp;quot;HEAD&amp;quot; of the CVS repo will appear as &#039;cvshead&#039; in GIT, making things a lot clearer.&lt;br /&gt;
&lt;br /&gt;
==Importing CVS Faster==&lt;br /&gt;
&lt;br /&gt;
For initial imports, it is highly recommended that you fetch the CVS repository from one of Moodle [[CVS_for_Administrators#CVS_Servers | cvs servers]] and run the initial cvsimport against your local copy of the repository. &lt;br /&gt;
&lt;br /&gt;
:: For the more adventurous: Keith Packard wrote another importer that does a better job at the initial import, called parsecvs. I use parsecvs for the initial import and then git-cvsimport daily for the incremental imports. --[[User:Martin Langhoff|Martin Langhoff]] 15:04, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
:: It took me a few minutes to find the info in the Sourceforge docs on how to fetch the raw CVS repo via rsync. Just type &#039;rsync -av &amp;quot;rsync://moodle.cvs.sourceforge.net/cvsroot/moodle/moodle/*&amp;quot; .&#039; (without the single quotes) and you&#039;ll be done --[[User:Iñaki Arenaza|Iñaki Arenaza]] 17:54, 25 December 2006 (CST). &lt;br /&gt;
&lt;br /&gt;
:: This rsync command line doesn&#039;t work as-is anymore, since the repository was moved from sourceforge. Some mirrors (at least es.cvs.moodle.org at this time) provide rsync, but some don&#039;t (like eu.cvs.moodle.org). Find the best mirror for you and update the rsync call accordingly.&lt;br /&gt;
&lt;br /&gt;
After the initial import, you can run git-cvsimport against your favorite cvs.moodle.org mirror repository, or update your local copy via rsync as sas demonstrated in [http://www.progsoc.org/~wildfire/git/update-repo.sh this script].&lt;br /&gt;
&lt;br /&gt;
==Creating a Working Copy==&lt;br /&gt;
&lt;br /&gt;
In order to use your repository you must clone yourself a working copy using [http://www.kernel.org/pub/software/scm/git/docs/git-clone.html git-clone].&lt;br /&gt;
&lt;br /&gt;
(Let&#039;s assume your destination directory above was /pub/scm/moodle)&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/git/moodle&lt;br /&gt;
 cd ~/git/moodle&lt;br /&gt;
 git clone /pub/scm/moodle.git&lt;br /&gt;
&lt;br /&gt;
This will clone the git filesystem you created from the CVS import into a working copy that you may make changes to and commit to.  You can then get updates from the main git repository that will be merged in amongst the changes to your local copy.&lt;br /&gt;
&lt;br /&gt;
If you are using the Cogito tools, you can use [http://www.kernel.org/pub/software/scm/cogito/docs/cg-clone.html cg-clone] to do this instead:&lt;br /&gt;
&lt;br /&gt;
 cg-clone /pub/scm/moodle.git ~/git/moodle&lt;br /&gt;
&lt;br /&gt;
==Using git effectively with Moodle==&lt;br /&gt;
&lt;br /&gt;
Git can be used to intelligently track changes for creating client installs based off your own local, base, customisations which in turn tracks changes to the main Moodle CVS.&lt;br /&gt;
&lt;br /&gt;
If you have a local git copy of the Moodle CVS repository you will have a number of heads such as: &#039;&#039;&#039;MOODLE_15_STABLE&#039;&#039;&#039;, &#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039;, and so on.  If you wish to create a new branch for your local customisations, you can base it off an existing HEAD (one of the CVS branches that exist in the main Moodle repository).  If you wish to create a new local branch, &#039;&#039;&#039;mymoodle&#039;&#039;&#039;,  based off the current stable 1.6 code you would:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git branch mymoodle MOODLE_16_STABLE&lt;br /&gt;
 git branch &#039;&#039;# lists all the current branches, should show &#039;&#039;&#039;mymoodle&#039;&#039;&#039;&lt;br /&gt;
 git checkout mymoodle &#039;&#039;# you are now working on the &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch&#039;&#039;&lt;br /&gt;
 &#039;&#039;# add some new files (i.e. themes, blocks, etc.)&#039;&#039;&lt;br /&gt;
 cg-add -r .&lt;br /&gt;
 cg-status &#039;&#039;# Will list your uncommited files&#039;&#039;&lt;br /&gt;
 cg-commit -m &amp;quot;Added base customisations.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
To return to the &#039;&#039;&#039;master&#039;&#039;&#039; HEAD, equivalent to the main Moodle CVS HEAD branch, you would have to use:&lt;br /&gt;
&lt;br /&gt;
 git branch master&lt;br /&gt;
&lt;br /&gt;
If you were running a nightly script to pull new Moodle CVS updates into your main git repository via git-cvsimport, you should also merge any new changes into your local branch:&lt;br /&gt;
&lt;br /&gt;
 cd /pub/scm/moodle.git&lt;br /&gt;
 git checkout mymoodle&lt;br /&gt;
 cg-merge MOODLE_16_STABLE&lt;br /&gt;
&lt;br /&gt;
If you wanted to use this custom local branch to create a new client install, you would use:&lt;br /&gt;
&lt;br /&gt;
 cg-clone /pub/scm/moodle.git#mymoodle /home/someclient/public_html/&lt;br /&gt;
&lt;br /&gt;
This would create a new git repository from your branch that could be used to do a client install which can, in turn, have the client&#039;s custom files added to it.  This entire process can be automated so that your &#039;&#039;&#039;mymoodle&#039;&#039;&#039; branch is tracking upstream changes from the Moodle CVS (&#039;&#039;&#039;MOODLE_16_STABLE&#039;&#039;&#039; in this example) and your client installs are tracking changes against your local branch.&lt;br /&gt;
&lt;br /&gt;
==Merging a patch from GIT into CVS==&lt;br /&gt;
&lt;br /&gt;
If you have cvs access, you can use the [http://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html git-cvsexportcommit] command to merge or cherry pick individual patches into &#039;&#039;upstream&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
::git-cvsexportcommit was initially written to do merges of NZOSVLE bugfixes into Moodle. Several tools and patches to GIT and Cogito come from the NZOSVLE team. [[User:Martin Langhoff|Martin Langhoff]] 14:55, 19 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
If the patches merge cleanly, future updates will recognise the already-applied patch. In that sense the merger in git is smarter than the merger in Cogito, consider using git-pull rather than cg-update. Note that if you see conflicts using git-pull you will have to work a bit harder to resolve them. Make sure you are familiar with handling merge conflicts with pure git before trying this.&lt;br /&gt;
&lt;br /&gt;
==Preparing to merge large patch series or porting over to the next Moodle release==&lt;br /&gt;
&lt;br /&gt;
When you have a large set of patches to apply to CVS, or a large set of custom patches to apply on top of the next release of Moodle, you can use [http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html git-format-patch] to see what are your &#039;&#039;unmerged&#039;&#039; patches. git-format-patch tries hard to spot already-merged patches and skip them. &lt;br /&gt;
&lt;br /&gt;
If you are applying patches to CVS, you can then use git-cvsexportcommit or plain old patch -p1 filename. If you are applying them to a new git branch (as you would to merge them on top of a new Moodle release) then you want to be on that new branch, and use git-am -3 -k filename.&lt;br /&gt;
&lt;br /&gt;
If you are using git-am, make sure you learn how to deal with merge conflicts, and the use of git-update-index.&lt;br /&gt;
&lt;br /&gt;
==Helpful Documentation==&lt;br /&gt;
&lt;br /&gt;
* [http://wellington.pm.org/archive/200510/git/ cogito tutorial by martin langhoff]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/tutorial.html git tutorial]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/gitcvs-migration.html git for CVS users]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/git-cvsimport.html git-cvsimport man page]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/cogito/docs/ cogito man pages]&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/ git man pages]&lt;br /&gt;
* [http://vger.kernel.org/vger-lists.html  The Git mailing list]&lt;br /&gt;
* [http://git.or.cz/gitwiki GitWiki]&lt;br /&gt;
* [http://www.kernel.org/git/ kernel.org Gitweb interface] (Browse the Git and associated tools&#039; repositories)&lt;br /&gt;
* [http://wiki.sourcemage.org/Git_Guide Straightforward Git guide] (for Git &amp;gt;= 1.5)&lt;br /&gt;
&lt;br /&gt;
==Moodle Forum Discussions==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=91998 Tracking Moodle CVS with git (take2)]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=42275 Tracking Moodle CVS with git]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66412 Moving to git, need serious help]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=99763 The continuing story of moving Moodle towards Git]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Tracking Moodle CVS with git]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=CVS_for_Administrators&amp;diff=44121</id>
		<title>CVS for Administrators</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=CVS_for_Administrators&amp;diff=44121"/>
		<updated>2008-09-21T20:35:59Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: updated luns website&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [http://cvs.moodle.org/ CVS archive] contains all the source code for Moodle. You can use a CVS program to extract versions ranging from the most stable release to the most cutting-edge development version. CVS can be an extremely convenient way of maintaining a Moodle server.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cvstree.png|CVS tree]]&lt;br /&gt;
&lt;br /&gt;
Developers may have selective write access to the Moodle CVS archive (see [[CVS for Developers]] for details about how to do this). However, most people only need read-only access, so they can just connect to one of the mirrors using &#039;&#039;&#039;anonymous CVS&#039;&#039;&#039; as described below. There can however currently be a delay of up to 1 hour between the time a developer commits changes to developer CVS and the time it becomes available on anonymous CVS. &lt;br /&gt;
&lt;br /&gt;
==CVS Servers==&lt;br /&gt;
&lt;br /&gt;
Please choose the closest CVS mirror server to you from this list:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Country&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Server&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Provided by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|EU&lt;br /&gt;
|&#039;&#039;&#039;eu.cvs.moodle.org&#039;&#039;&#039;&lt;br /&gt;
|[http://www.open.ac.uk/ The Open University] In case of trouble, contact [mailto:r.t.c.norfor@open.ac.uk Rod Norfor] or [mailto:d.a.woolhead@open.ac.uk Derek Woolhead]&lt;br /&gt;
|-&lt;br /&gt;
|ES&lt;br /&gt;
|&#039;&#039;&#039;es.cvs.moodle.org&#039;&#039;&#039;&lt;br /&gt;
|[http://www.mondragon.edu/ Mondragon Unibertsitatea] In case of trouble, contact [mailto:iarenuno@eteo.mondragon.edu iarenuno@eteo.mondragon.edu] or [mailto:iarenaza@escomposlinux.org iarenaza@escomposlinux.org]&lt;br /&gt;
|-&lt;br /&gt;
|UK&lt;br /&gt;
|&#039;&#039;&#039;uk.cvs.moodle.org&#039;&#039;&#039;&lt;br /&gt;
|Cumbria and Lancashire Education Online ([http://www.cleo.net.uk/ CLEO]) in collaboration with Lancaster University Network Services ([http://www.luns.net.uk/ LUNS])&lt;br /&gt;
|-&lt;br /&gt;
|US&lt;br /&gt;
|&#039;&#039;&#039;us.cvs.moodle.org&#039;&#039;&#039;&lt;br /&gt;
|San Francisco State University, Academic Technology ([http://www.sfsu.edu/ SFSU]). In case of trouble, contact [mailto:ilearn@sfsu.edu iLearn support]&lt;br /&gt;
|-&lt;br /&gt;
|US&lt;br /&gt;
|&#039;&#039;&#039;us2.cvs.moodle.org&#039;&#039;&#039;&lt;br /&gt;
|[http://www.contractorsinstitute.com The Contractors Institute] pserver and viewvc. In case of trouble contact [mailto:cvs@contractorsinstitute.com network support].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Replace the SERVER.cvs.moodle.org in the instructions below with the server you chose above!&lt;br /&gt;
&lt;br /&gt;
For up-to-date alerts about planned or unplanned outages on any of these servers subscribe to the [http://lists.moodle.org/info/outages Moodle Outage mailing list].&lt;br /&gt;
&lt;br /&gt;
(If you would like to contribute to the project by running a mirror, please see [[How to set up a CVS mirror]])  &lt;br /&gt;
&lt;br /&gt;
===Switching to a new server===&lt;br /&gt;
&lt;br /&gt;
If you were &#039;&#039;already&#039;&#039; using CVS and want to switch to a different server, you&#039;ll probably need to make a small change so that the control files in your working copy will point to the new mirrors. &lt;br /&gt;
&lt;br /&gt;
====Switching to a new server on Unix====&lt;br /&gt;
&lt;br /&gt;
Use a shell command like this to change existing installations to point to the new mirror (UK mirror used in this example):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;find . -type f -name Root -print0 | xargs -0 perl -pi -e &#039;s/\@moodle\.cvs\.sourceforge\.net/\@uk\.cvs\.moodle\.org/&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
It can be run from /home, say, to fix multiple sites at once.&lt;br /&gt;
&lt;br /&gt;
====Switching to a new server with TortoiseCVS====&lt;br /&gt;
&lt;br /&gt;
If you were &#039;&#039;already&#039;&#039; using Tortoise CVS on Windows it&#039;s tricky, because Tortoise doesn&#039;t have any interface for changing the server.  http://www.tortoisecvs.org/faq.html#changecvsroot explains it.  But basically, &lt;br /&gt;
&lt;br /&gt;
 1) Install WinCVS and launch it. &lt;br /&gt;
 2) Navigate to and select your Moodle folder. &lt;br /&gt;
 3) Choose &#039;Macros&#039;-&amp;gt;CVS-&amp;gt;Change Root from the menu.  &lt;br /&gt;
 4) Accept (or change) the default for the &#039;old&#039; server. &lt;br /&gt;
 5) Type the new server name. OK!  &lt;br /&gt;
&lt;br /&gt;
It takes a few seconds to go through all of the &#039;&#039;&#039;cvs&#039;&#039;&#039; folders and update the &#039;&#039;&#039;root&#039;&#039;&#039; files.&lt;br /&gt;
&lt;br /&gt;
By the way, if you don&#039;t want to install WinCVS, another way of doing this is to uninstall your TortoiseCVS client on Windows, then do a regedit to clean up all the tortoisecvs related entries (might not be necessary), then reinstall TortoiseCVS client again (a good reason to upgrade to the most recent version of TortoiseCVS!). I have tested this and it cleared up the original setting of the original anonymous CVS server setting.&lt;br /&gt;
&lt;br /&gt;
==Instructions==&lt;br /&gt;
&lt;br /&gt;
===From a Unix computer===&lt;br /&gt;
&lt;br /&gt;
To connect and login for the first time to the CVS server, you can use this command (remember to replace &#039;&#039;&#039;SERVER.cvs.moodle.org&#039;&#039;&#039; in the instructions below with the mirror server you chose above):&lt;br /&gt;
&lt;br /&gt;
 cvs -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle login&lt;br /&gt;
&lt;br /&gt;
There is no password - when asked for one, just hit Enter.&lt;br /&gt;
&lt;br /&gt;
To checkout (download) the entire Moodle code for the first time, use this command to get the latest WEEKLY version (generally the latest, most bug free version):&lt;br /&gt;
&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co -P -r MOODLE_19_WEEKLY moodle&lt;br /&gt;
&lt;br /&gt;
Or the latest development version (not for production use):&lt;br /&gt;
&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co -P moodle&lt;br /&gt;
&lt;br /&gt;
Or the modules in Contrib&lt;br /&gt;
&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co contrib&lt;br /&gt;
&lt;br /&gt;
Later, to update your local copy of Moodle to the current version in CVS you just need to go into your local Moodle directory and type:&lt;br /&gt;
&lt;br /&gt;
 cvs update -dP&lt;br /&gt;
&lt;br /&gt;
To update your local copy of Moodle to a new version (e.g. from 1.8+ to 1.9), go into your local Moodle directory and type:&lt;br /&gt;
&lt;br /&gt;
 cvs update -dP -r MOODLE_19_STABLE&lt;br /&gt;
&lt;br /&gt;
To update your local copy and to save the log of the process, use the following command instead the previous one:&lt;br /&gt;
&lt;br /&gt;
 cvs update -dP -r MOODLE_19_STABLE | tee upgrade.log&lt;br /&gt;
&lt;br /&gt;
Then look at the upgrade.log, notably look for lines starting with &amp;quot;C&amp;quot; (conflict):&lt;br /&gt;
&lt;br /&gt;
 grep &#039;^C&#039; upgrade.log&lt;br /&gt;
&lt;br /&gt;
Conflicts may appear in case you have manually modified your source files. You have to resolve conflicts before using the site. See [[CVS for Developers]] for more details.&lt;br /&gt;
&lt;br /&gt;
===Changing the directory name===&lt;br /&gt;
&lt;br /&gt;
By default, the CVS checkout creates a diectory on your webserver called &#039;moodle&#039;. If you want your Moodle installation in a different directory, you can change the name of the directory that it will checkout the files to, by typing the follwing. This would download the MOODLE_19_STABLE branch into a directory called &amp;quot;mydirectory&amp;quot; (-d mydirectory).&lt;br /&gt;
&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co &#039;&#039;&#039;-d mydirectory&#039;&#039;&#039; -r MOODLE_19_STABLE moodle&lt;br /&gt;
&lt;br /&gt;
Or the latest development version to a directory called &#039;moodle-dev&#039;:&lt;br /&gt;
&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle co &#039;&#039;&#039;-d moodle-dev&#039;&#039;&#039; moodle&lt;br /&gt;
&lt;br /&gt;
You can also change the name of the directory after the files are downloaded, and before you go through the Moodle install process. If you change the name of the directory before install, it will not affect anything during the install or during a CVS update. If you change the name of the directory after an install, you will need to change the config.php to reflect the name change ([[Moodle_migration#Migrating_a_complete_Moodle_site|guidance here]]). It won&#039;t affect the CVS update though.&lt;br /&gt;
&lt;br /&gt;
===Change directory owner===&lt;br /&gt;
&lt;br /&gt;
Depending on your webserver setup, you may well need to change the owner of the directory to the webserver user. Follow this step if you get permissions error when you try to access the page. For apache:&lt;br /&gt;
  &lt;br /&gt;
  chown -R www-data:www-data moodle&lt;br /&gt;
&lt;br /&gt;
===From a Windows computer===&lt;br /&gt;
&lt;br /&gt;
To get started with a fresh copy of Moodle, follow the following steps (remember to replace  &#039;&#039;&#039;SERVER.cvs.moodle.org&#039;&#039;&#039; in the instructions below with the mirror server you chose above):[[Image:CVS moodle settings for tortoise CVS.jpg|thumb|Tortoise CVS Screen capture]]&lt;br /&gt;
[[Image:Ecran cvs.jpg|thumb|Tortoise CVS (real name) Screen capture]]&lt;br /&gt;
# Get TortoiseCVS from [http://www.tortoisecvs.org/ tortoisecvs.org] and install it, then reboot.&lt;br /&gt;
# Find or create a new folder somewhere where you want Moodle to be downloaded to.&lt;br /&gt;
# Right-mouse-click that folder and choose &amp;quot;CVS Checkout&amp;quot; from the menu. You should see a dialog box. &lt;br /&gt;
# Copy this text into the CVSROOT field: &amp;lt;code&amp;gt;:pserver:anonymous@SERVER.cvs.moodle.org:/cvsroot/moodle&amp;lt;/code&amp;gt;&lt;br /&gt;
#* NOTE - replace &amp;quot;SERVER&amp;quot; with &amp;quot;eu&amp;quot;, &amp;quot;es&amp;quot;, &amp;quot;uk&amp;quot; or &amp;quot;us&amp;quot; depending on your location.&lt;br /&gt;
# Under the &amp;quot;Module&amp;quot; field, type &amp;quot;moodle&amp;quot; to get moodle. (Other options here include&amp;quot;contrib&amp;quot; to get the contrib directory of hacks and addons, or &amp;quot;mysql&amp;quot; to get the optional MySQL Admin module).&lt;br /&gt;
#* For the latest STABLE version, click on the &amp;quot;Revision&amp;quot; tab and then check the radio button labelled &amp;quot;Choose branch or tag&amp;quot;. From the drop-down menu select MOODLE_18_STABLE.&lt;br /&gt;
#* If you don&#039;t see the very latest version in the long drop-down list under Branch or tag name, click the Update List button next to it and wait for the list to be updated.&lt;br /&gt;
#* For the latest UNSTABLE development version, the radio-button &amp;quot;Use HEAD branch&amp;quot; in the Revision tab should be checked.&lt;br /&gt;
# Press the button: &amp;quot;OK&amp;quot; and everything should be downloaded. &lt;br /&gt;
&lt;br /&gt;
Later, to update your local copy of Moodle to the current version in CVS, just right-mouse-click the folder and choose &amp;quot;CVS Update&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that the enclosing moodle folder is self-contained - you can move it anywhere you like or even rename it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE.-&#039;&#039;&#039; Admins with a developer account on cvs.moodle.org can connect with their account name, see attached screen shot.&lt;br /&gt;
&lt;br /&gt;
===From a Mac OS X computer===&lt;br /&gt;
You will find some information about CVS and Mac OS X  in the documentation for the complete installation package Moodle4Mac. Please read [[Complete_Install_Packages_for_Mac_OS_X#How_To_Update_Your_Moodle4Mac | How To Update Your Moodle4Mac]]. It works fine with the new CVS servers.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
&lt;br /&gt;
If you see something like this, make sure that there is not some firewall blocking the port (it&#039;s 2401):&lt;br /&gt;
&lt;br /&gt;
 $ cvs -d:pserver:anonymous@us.cvs.moodle.org:/cvsroot/moodle login&lt;br /&gt;
 Logging in to :pserver:anonymous@us.cvs.moodle.org:2401/cvsroot/moodle&lt;br /&gt;
 CVS password:&lt;br /&gt;
 cvs [login aborted]: connect to us.cvs.moodle.org(130.212.64.111):2401 failed: Connection timed out&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Development:Setting up Eclipse]] for step by step instructions for setting up the [http://www.eclipse.org/ Eclipse IDE] for Moodle development, which including how to do the necessary CVS operations.&lt;br /&gt;
* [[Development:Tracking Moodle CVS with git]]&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=26731&amp;amp;parent=125858 Using cvs]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=91891 CVS Updating of 3rd-Party Plug-ins in the Moodle folder itself]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
&lt;br /&gt;
[[fr:CVS pour administrateurs]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Developer_meeting_September_2008&amp;diff=44026</id>
		<title>Developer meeting September 2008</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Developer_meeting_September_2008&amp;diff=44026"/>
		<updated>2008-09-19T08:26:28Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Moodle 2.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Developer conferences|Developer meetings]] &amp;gt; September 2008 meeting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Date: 7am GMT on Friday, 19 September 2008 - see the [http://moodle.org/calendar/view.php?view=day&amp;amp;course=5&amp;amp;cal_d=19&amp;amp;cal_m=9&amp;amp;cal_y=2008 Moodle Developer Meeting calendar entry] for conversion into your time zone &lt;br /&gt;
*Location: [http://elluminate.remote-learner.net/join_meeting.html?meetingId=1176914355734 Elluminate Moodle Developers Meeting Room] - login using your actual name as login name and password &#039;&#039;moodle&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome, though [http://moodle.org/mod/cvsadmin/view.php?id=7134 developers with CVS write access] will be given preference if the room becomes full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And don&#039;t forget .....  [http://www.talklikeapirate.com/piratehome.html YARRRRRR!!!]&lt;br /&gt;
&lt;br /&gt;
==Moodle 2.0==&lt;br /&gt;
&lt;br /&gt;
* Demo and discussion of the new [[Development:File API|Files]] and [[Development:Repository API|Repository]] interfaces  (Martin etc)&lt;br /&gt;
* Demo and discussion of the [[Development:Portfolio API|Portfolio]] interfaces  (Penny etc)&lt;br /&gt;
* Demo and discussion of [[Development:Conditional activities|Activity completion]] (Sam?)&lt;br /&gt;
* Demo and discussion of new [[Development:Messaging 2.0|Messaging system]]&lt;br /&gt;
* Demo and discussion of new External Activities module, the successor to the HotPot module (Gordon)&lt;br /&gt;
* Demo and discussion of IMS LTI 2.0 consumer module(Ludo and J.Piguillem)...&lt;br /&gt;
* Wiki refactoring roadmap&lt;br /&gt;
* Usability testing of new features (See page comments by Gary Anderson)&lt;br /&gt;
* (if there&#039;s time and interest) [[https://docs.moodle.org/en/Feedback_link_for_all_elements Feedback links for most all  elements]] (Jeff Forssell)&lt;br /&gt;
* If anyone wants to see, I can show a quick demo of current googledocs/picasa plugins portfolio/repo at the end (danp)&lt;br /&gt;
&lt;br /&gt;
==Other news==&lt;br /&gt;
&lt;br /&gt;
*[[GSOC/2008|Google Summer of Code 2008]] (Helen)&lt;br /&gt;
* OLPC School Server integrating Moodle (Martin L)&lt;br /&gt;
** Translation&lt;br /&gt;
** OUBlog stuff&lt;br /&gt;
** Offline moodle based on Google Gears&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Developer_meeting_September_2008&amp;diff=44025</id>
		<title>Developer meeting September 2008</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Developer_meeting_September_2008&amp;diff=44025"/>
		<updated>2008-09-19T08:25:56Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Moodle 2.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Developer conferences|Developer meetings]] &amp;gt; September 2008 meeting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Date: 7am GMT on Friday, 19 September 2008 - see the [http://moodle.org/calendar/view.php?view=day&amp;amp;course=5&amp;amp;cal_d=19&amp;amp;cal_m=9&amp;amp;cal_y=2008 Moodle Developer Meeting calendar entry] for conversion into your time zone &lt;br /&gt;
*Location: [http://elluminate.remote-learner.net/join_meeting.html?meetingId=1176914355734 Elluminate Moodle Developers Meeting Room] - login using your actual name as login name and password &#039;&#039;moodle&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome, though [http://moodle.org/mod/cvsadmin/view.php?id=7134 developers with CVS write access] will be given preference if the room becomes full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And don&#039;t forget .....  [http://www.talklikeapirate.com/piratehome.html YARRRRRR!!!]&lt;br /&gt;
&lt;br /&gt;
==Moodle 2.0==&lt;br /&gt;
&lt;br /&gt;
* Demo and discussion of the new [[Development:File API|Files]] and [[Development:Repository API|Repository]] interfaces  (Martin etc)&lt;br /&gt;
* Demo and discussion of the [[Development:Portfolio API|Portfolio]] interfaces  (Penny etc)&lt;br /&gt;
* Demo and discussion of [[Development:Conditional activities|Activity completion]] (Sam?)&lt;br /&gt;
* Demo and discussion of new [[Development:Messaging 2.0|Messaging system]]&lt;br /&gt;
* Demo and discussion of new External Activities module, the successor to the HotPot module (Gordon)&lt;br /&gt;
* Demo and discussion of IMS LTI 2.0 consumer module(Ludo and J.Piguillem)...&lt;br /&gt;
* Wiki refactoring roadmap&lt;br /&gt;
* Usability testing of new features (See page comments by Gary Anderson)&lt;br /&gt;
* (if there&#039;s time and interest) [[https://docs.moodle.org/en/Feedback_link_for_all_elements Feedback links for most all  elements]] (Jeff Forssell)&lt;br /&gt;
* If anyone wants to see, I can show a quick demo of current googledocs plugins (danp)&lt;br /&gt;
&lt;br /&gt;
==Other news==&lt;br /&gt;
&lt;br /&gt;
*[[GSOC/2008|Google Summer of Code 2008]] (Helen)&lt;br /&gt;
* OLPC School Server integrating Moodle (Martin L)&lt;br /&gt;
** Translation&lt;br /&gt;
** OUBlog stuff&lt;br /&gt;
** Offline moodle based on Google Gears&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development_talk:File_API&amp;diff=38296</id>
		<title>Development talk:File API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development_talk:File_API&amp;diff=38296"/>
		<updated>2008-06-25T09:16:24Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some quick questions to avoid forgetting them:&lt;br /&gt;
&lt;br /&gt;
1) Will them be under the control of FileAPI (or, as they are now, fixed local storage)?&lt;br /&gt;
&lt;br /&gt;
- dataroot/temp&lt;br /&gt;
- dataroot/lang&lt;br /&gt;
- dataroot/cache&lt;br /&gt;
- dataroot/environment&lt;br /&gt;
- dataroot/filter&lt;br /&gt;
- dataroot/rss&lt;br /&gt;
- dataroot/search&lt;br /&gt;
- dataroot/sessions&lt;br /&gt;
- dataroot/upgradelogs&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : I don&#039;t see these as being in the API - I&#039;ve updated the spec.&lt;br /&gt;
&lt;br /&gt;
2) Assuming we&#039;ll have a cool OOP FileAPI... &lt;br /&gt;
&lt;br /&gt;
- a) Will it support different FileAPI classes (to be able to store in other systems) ?&lt;br /&gt;
- b) Will it support multiple FileAPI classes working together (like the Repo) ?&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : Hmm, I suppose it makes sense to switch the backend from local file storage to specify something else (eg database storage) but multiple File storage places doesn&#039;t make sense to me, that is the Repository API and the Portfolio API.  &lt;br /&gt;
&lt;br /&gt;
3) I&#039;ve annotated in red some things that have sounded strange in my first look.&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : Thanks, all fixed.  &lt;br /&gt;
&lt;br /&gt;
4) Are we going to have &amp;quot;directory records&amp;quot; in the implementation, or that is going to be handled exclusively by the &amp;quot;moodlepath&amp;quot; column?&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : Good point.  I was thinking of moodlepath only but I wonder if directory records might be more efficient.  New table, I guess.&lt;br /&gt;
&lt;br /&gt;
5) One general question... are we going to &amp;quot;force&amp;quot; all modules to be &amp;quot;autocontained&amp;quot; ? How are we going to handle resources, for example (with all those css, links, images..). In general how are we going to handle multiple-file packages?&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : they&#039;ll be a set of files, probably in a &amp;quot;directory&amp;quot; specified by moodlepath of directory record.  What problems do you see?  Should we retain better knowledge of the original group of files?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#039;s all for now, ciao4niao :-) [[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 21:27, 5 April 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making Storage &#039;content addressable&#039; ==&lt;br /&gt;
One opportunity  which this API opens up is the possibility of making the actual storage of files &#039;content addressable&#039; . That is, if two users upload the same image for example, only store this file once on disk. This  brings benefits in reducing the amount of storage and improving caching (especially in increasingly common situations the moodle data store served from a NFS directory or other remote storage similar). To do this we could use a hash like sha-1 on the file and store the file on disk named by its hash (rather than some arbitary id). Then when someone uploads the same file as has already been uploaded, the hash matches and we just point the database record to the same file on disk. This technique is increasingly being used by enterprise-style repositories as well as things like git. I can see the major benefits in things like scorm packages other such things which have 100&#039;s of small duplicate files stored multiple times per package and course, so sometimes you can have the same image file stored 20 different times across 20 different packages in one course, which is then duplicated for multiple classes etcetc. --[[User:Dan Poltawski|Dan Poltawski]] 07:32, 1 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
 Excellent idea, Dan, it&#039;s in   [[User:Martin Dougiamas|Martin Dougiamas]] 01:43, 20 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Specific File Attachments? ==&lt;br /&gt;
&lt;br /&gt;
We have entries for &#039;moduleinstance&#039;, do we need entries to identify files per other attachments? Such as forum posts, wiki attachments, database attachments, assignment submissions?&lt;br /&gt;
[[User:Mike Churchward|Mike Churchward]] 16:27, 9 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
 I&#039;m not sure if we need to have such links back to the exact forum post &lt;br /&gt;
 or glossary entry.  The idea is that the forum posts (say) would reference &lt;br /&gt;
 the file-&amp;gt;id.  Would it be useful to have back links too ...?   &lt;br /&gt;
 [[User:Martin Dougiamas|Martin Dougiamas]] 22:30, 22  June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
==Squid==&lt;br /&gt;
&lt;br /&gt;
Consider proxy support. --[[User:Helen Foster|Helen Foster]] 16:53, 9 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
Expanding on this from the hackfest discussion - since we are hashing for storage anyway, we could&lt;br /&gt;
serve the sha1 hash as the Etag for every file quite easily. --[[User:Dan Poltawski|Dan Poltawski]] 04:16, 25 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
== Batch uploads (zips) ==&lt;br /&gt;
&lt;br /&gt;
Should we require that file API (optionally) require some form of batch file upload or zip/unzip function?&lt;br /&gt;
[[User:Mike Churchward|Mike Churchward]] 17:14, 9 June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
 Yeah, it definitely needs to handle zipped files nicely ... [[User:Martin Dougiamas|Martin Dougiamas]] 22:33, 22  June 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
=Skodak&#039;s rants=&lt;br /&gt;
&lt;br /&gt;
The API should be split into several independent parts:&lt;br /&gt;
# File serving API&lt;br /&gt;
## file.php&lt;br /&gt;
## pluginfile.php&lt;br /&gt;
## userfile.php&lt;br /&gt;
## rssfile.php&lt;br /&gt;
# File storage API&lt;br /&gt;
## optional access control&lt;br /&gt;
## optional repo sync&lt;br /&gt;
# File management API&lt;br /&gt;
## File browsing&lt;br /&gt;
## File linking (editor integration)&lt;br /&gt;
## Upload from repository&lt;br /&gt;
&lt;br /&gt;
==File serving API==&lt;br /&gt;
Deals with serving of files - browser requests file, Moodle sends it back. We have three main files.&lt;br /&gt;
&lt;br /&gt;
===file.php===&lt;br /&gt;
Serves course files. &lt;br /&gt;
It would be nice to have some special hardcoded protection of backup files - preventing of backup file downloads/uploads; backups contain a lot of personal info, we could block restoring of backups from other sites too.&lt;br /&gt;
&lt;br /&gt;
Implements basic file access. Ideally only images and files linked from course sections should be there, no XSS protection required - we expect javascript, sw, etc. there, no way to make it &amp;quot;secure&amp;quot;. The access control is not critical any more if we move most most of the files into modules; &lt;br /&gt;
&lt;br /&gt;
 /file.php/courseid/dir/dir/filename.ext&lt;br /&gt;
&lt;br /&gt;
===pluginfile.php=== (aka modfile.php)&lt;br /&gt;
Sends module, block, question files. Absolute file links need to be rewritten if html editing allowed in module. The links are stored internally as relative links.&lt;br /&gt;
* modules decide about access control&lt;br /&gt;
* optional XSS protection - student submitted files must not be served with normal headers, we have to force download instead; ideally there should be second wwwroot for serving of untrusted files&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/contextid/arbitrary/params/or/dirs/filename.ext&lt;br /&gt;
&lt;br /&gt;
pluginfile.php detects the type of plugin from context table, fetches basic info (like $course or $cm if appropriate) and calls plugin function (or later method) which does the access control and finally sends the file to user.&lt;br /&gt;
&lt;br /&gt;
====blog example====&lt;br /&gt;
Blog entries or notes in general do not have context id (because they live in system context).&lt;br /&gt;
The note attachments are always served with XSS protection on, ideally we should use separate wwwroot for this. Access control can be hardcoded.&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/SYSCONTEXTID/blog/blogenryid/attachmentname.ext&lt;br /&gt;
&lt;br /&gt;
====assignment example====&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/assignmentcontextid/submission/userid/attachmentname.ext&lt;br /&gt;
 /pluginfile.php/assignmentcontextid/downloadall/file.zip&lt;br /&gt;
&lt;br /&gt;
====scorm example====&lt;br /&gt;
&lt;br /&gt;
 /pluginfile.php/scormcontextid/revisionnumber/dir/somescormfile.js&lt;br /&gt;
&lt;br /&gt;
The revision counter is incremented when any file changes in order to prevent caching problems. The lifetime should be adjustable in module settings.&lt;br /&gt;
&lt;br /&gt;
===questions example===&lt;br /&gt;
&lt;br /&gt;
 pluginfile.php/SYSCONTEXTID/question/questionid/file.jpg&lt;br /&gt;
&lt;br /&gt;
===userfile.php===&lt;br /&gt;
Personal file storage&lt;br /&gt;
* read/write own files only for now&lt;br /&gt;
&lt;br /&gt;
 /userfile.php/userid/dir/dir/filename.ext&lt;br /&gt;
&lt;br /&gt;
===rssfile.php===&lt;br /&gt;
Replaces rss/file.php wchi is kept only for backwards compatibility.&lt;br /&gt;
RSS files should not require sessions/cookies, urls should contain some sort of security token/key&lt;br /&gt;
Internally the files may be stored in database or together with other files.&lt;br /&gt;
Etag support should be implemented to improve performance.&lt;br /&gt;
&lt;br /&gt;
 /rssfile.php/contextid/any/parameters/module/wants/rss.xml&lt;br /&gt;
 /rssfile.php/SYSCONTEXTID/blog/userid/rss.xml&lt;br /&gt;
&lt;br /&gt;
Again modules and plugins decide what gets sent to user.&lt;br /&gt;
&lt;br /&gt;
==File storage API==&lt;br /&gt;
&lt;br /&gt;
File contents are stored in moodledata/filepool using sha1 hashes instead of file names.&lt;br /&gt;
&lt;br /&gt;
=== file table ===&lt;br /&gt;
&lt;br /&gt;
This table contains one entry for every file.  Enough information is kept here so that the file can be fully identified and retrieved again if necessary.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|sha1hash&lt;br /&gt;
|varchar(40)&lt;br /&gt;
|&lt;br /&gt;
|The sha1 hash of content.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;contextid&#039;&#039;&#039; &lt;br /&gt;
|int(10)&lt;br /&gt;
| &lt;br /&gt;
|The context id defined in context table - identifies the instance of plugin owning the file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|instanceid&lt;br /&gt;
|int(10)&lt;br /&gt;
| &lt;br /&gt;
|Optional - some plugin specific instance id (eg. forum post, blog entry or assignment submission, user id for user files)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|plugin&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The module that is the &amp;quot;owner&amp;quot; of this file (eg &amp;quot;moodle&amp;quot;, &amp;quot;blog&amp;quot;, &amp;quot;mod/assignment&amp;quot; or &amp;quot;blocks/html&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|filetype&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Like submissions, filemanager files (images and swf linked from summaries), etc.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|filename&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The full Unicode name of this file (case sensitive)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|filepath&lt;br /&gt;
|text&lt;br /&gt;
|NULL&lt;br /&gt;
|Optional - relative path to file from module content root, useful in Scorm and Resource mod - most of the mods do not need this&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|timecreated&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time this file was created (if known), otherwise same as time imported&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|timemodified&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The last time the file was modified&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|filesize&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|size of file - bytes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|userid&lt;br /&gt;
|int(10)  &lt;br /&gt;
|NULL&lt;br /&gt;
|Optional - general id field - meaning depending on plugin&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
index on &amp;quot;contextid, instanceid&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== file_metadata table ===&lt;br /&gt;
&lt;br /&gt;
This table contains extra metadata about files.  Repositories could provide this, or it could be manually edited in the local copy.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fileid&#039;&#039;&#039; &lt;br /&gt;
|int(10)&lt;br /&gt;
| &lt;br /&gt;
|Id of file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The name of extra metadata&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Value&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== file_access ===&lt;br /&gt;
&lt;br /&gt;
This table describes optional ACL for file.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fileid&#039;&#039;&#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
| &lt;br /&gt;
|The file we are defining access for&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;contextid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The context where this file is being published&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;capability&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|The capability that is required to see this file.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== repository_sync table ===&lt;br /&gt;
&lt;br /&gt;
This table contains information how to synchronise data with repositories.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fileid&#039;&#039;&#039; &lt;br /&gt;
|int(10)&lt;br /&gt;
| &lt;br /&gt;
|Id of file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;repositoryid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The repository instance this is associated with, see [[Development:Repository_API]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|updates&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Specifies the update schedule (0 = none, 1 = on demand, other = some period in seconds)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|repositorypath&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|The full path to the original file on the repository&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|timeimportfirst&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The first time this file was imported into Moodle&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|timeimportlast&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The most recent time that this file was imported into Moodle&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==File management API==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Some little comments to be considered (to avoid forgetting them) ===&lt;br /&gt;
&lt;br /&gt;
* file_access ???? stands for ????&lt;br /&gt;
* each context will have its own &amp;quot;file manager&amp;quot;&lt;br /&gt;
* separate &amp;quot;file manager context&amp;quot; files (FMF) and &amp;quot;internal context&amp;quot; (ICF) files (current modedit files, submissions, attachements...)&lt;br /&gt;
* /pluginfile.php/SYSCONTEXTID/{blog|question} and so... will have own FMF too? Or only ICF ?&lt;br /&gt;
* rssfile.php: I&#039;d support both Etag (cool) and Last-Modified (more used), when we receive If-None-Match/If-Modified-Since =&amp;gt; 304&lt;br /&gt;
* Way to migrate&lt;br /&gt;
* Way to copy between contexts&lt;br /&gt;
* Links = -1 for them&lt;br /&gt;
* Deletion strategy (locks, quarantine status...)&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=GSOC/2008&amp;diff=37907</id>
		<title>GSOC/2008</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=GSOC/2008&amp;diff=37907"/>
		<updated>2008-06-19T19:25:10Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Feed aggregation library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Overview of the [http://code.google.com/soc/2008/ Google Summer of Code 2008] projects for Moodle.   Thanks to Google for the opportunity to get these developed!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Detecting and solving specific usability issues==&lt;br /&gt;
&lt;br /&gt;
The main objective of this project is to detect and solve specific usability issues.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=518567&amp;amp;course=5 Laia Subirats Maté]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=153093&amp;amp;course=5 David Horat] and [http://moodle.org/user/view.php?id=51473&amp;amp;course=5 Anthony Borrow]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Usability issues|Usability issues]]&lt;br /&gt;
&lt;br /&gt;
==XMLDB/SQLite==&lt;br /&gt;
&lt;br /&gt;
This project is about adding SQLite to the Moodle database abstraction layer and adding a mechanism to copy a live Moodle database into a SQLite database to implement a mechanism to switch into &#039;testing mode&#039; using a SQLite copy of the live database.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=273885&amp;amp;course=1 Andrei Bautu]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=17383&amp;amp;course=5 Penny Leach]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/SQLite|SQLite]]&lt;br /&gt;
&lt;br /&gt;
==Animated grade statistics report==&lt;br /&gt;
&lt;br /&gt;
This project is about using the [http://flare.prefuse.org/ Flare library] to develop some cool and useful visualisation of information in the Moodle gradebook.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=544902&amp;amp;course=1 Daniel Servos]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=521521&amp;amp;course=1 Greg Wilson], [http://moodle.org/user/view.php?id=51473&amp;amp;course=5 Anthony Borrow] and [http://moodle.org/user/view.php?id=240338&amp;amp;course=5 Nicolas Connault]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Animated grade statistics report|Animated grade statistics report]]&lt;br /&gt;
&lt;br /&gt;
==Web 2.0 language editing interface==&lt;br /&gt;
&lt;br /&gt;
Moodle is [[Translation|designed to be translated]] into many languages, and currently has over 70 language packs. The existing [[Language editing|language editing]] interface enables translators to check for untranslated words or phrases and also enables Moodle administrators to change words or phrases used in Moodle.&lt;br /&gt;
&lt;br /&gt;
This project will involve creating a Web 2.0 language editing interface which will include features such as syntax error detection, a search and replace function for changing a particular word and a spell checker.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=544037&amp;amp;course=1 Avi Mehta]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=1601&amp;amp;course=5 David Mudrák], [http://moodle.org/user/view.php?id=12863&amp;amp;course=5 Petr Skoda (Skodak)] and [http://moodle.org/user/view.php?id=3923&amp;amp;course=5 Koen Roggemans]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Language editing interface|Language editing interface]]&lt;br /&gt;
&lt;br /&gt;
==Feed aggregation library==&lt;br /&gt;
&lt;br /&gt;
This project involves creating a feed aggregation library to take care of aggregating feeds (and the issues around it) and to provide them in a simple format for plugins and other core parts of Moodle to use.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=521708&amp;amp;course=1 Chris Zubak-Skees]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=104159&amp;amp;course=5 Dan Poltawski]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Feed aggregation library|Feed aggregation library]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tracker Issue&#039;&#039;&#039;: [http://tracker.moodle.org/browse/CONTRIB-504 CONTRIB-504]&lt;br /&gt;
&lt;br /&gt;
==New customisable theme==&lt;br /&gt;
&lt;br /&gt;
This project is about creating a theme for Moodle 1.9 which is customizable via a configuration page in Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=526259&amp;amp;course=1 Akshit Sharma]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=11995 Shane Elliott]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Customisable theme|Customisable theme]]&lt;br /&gt;
&lt;br /&gt;
==Blog improvements and the addition of a blog assignment module==&lt;br /&gt;
&lt;br /&gt;
The existing [[Blog]] functionality will be improved as part of this project, and a blog assignment type developed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=27192&amp;amp;course=5 Joey Morwick]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=423027&amp;amp;course=5 Mathieu Petit-Clair]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Blog improvements|Blog improvements]]&lt;br /&gt;
&lt;br /&gt;
==Messaging improvements==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=274199&amp;amp;course=1 Luis Filipe Romão Rodrigues]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=1 Martin Dougiamas]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Further messaging improvements|Further messaging improvements]]&lt;br /&gt;
&lt;br /&gt;
==Automatic accessibility checking==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=519485&amp;amp;course=1 David W. Knight]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=153093&amp;amp;course=5 David Horat] and [http://moodle.org/user/view.php?id=1 Martin Dougiamas]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Automatic accessibility checking|Automatic accessibility checking]]&lt;br /&gt;
&lt;br /&gt;
==Competency tracking==&lt;br /&gt;
&lt;br /&gt;
This project is about tracking the competency of a user based on the course outcome, the desired grade and the grade that the user obtained for the course.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=175392&amp;amp;course=5 Sarves Kengatharaiyer]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=1 Martin Dougiamas] and [http://moodle.org/user/view.php?id=152257 Jonathan Newman]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Competency tracking|Competency tracking]]&lt;br /&gt;
&lt;br /&gt;
==Secure RSS feeds==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=525809&amp;amp;course=5 Askar Salimbaev]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=240338&amp;amp;course=5 Nicolas Connault]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Secure RSS feeds|Secure RSS feeds]]&lt;br /&gt;
&lt;br /&gt;
==Moodle IDE==&lt;br /&gt;
&lt;br /&gt;
This project is about creating a Moodle integrated development environment (IDE), based on Eclipse, so that new developers can begin developing Moodle in less time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Student&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=543819&amp;amp;course=1 Grady Laksmono]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [http://moodle.org/user/view.php?id=12863&amp;amp;course=5 Petr Skoda (Skodak)] and [http://moodle.org/user/view.php?id=51473&amp;amp;course=5 Anthony Borrow]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full specification&#039;&#039;&#039;: [[Student projects/Moodle IDE|Moodle IDE]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development_talk:File_API&amp;diff=36933</id>
		<title>Development talk:File API</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development_talk:File_API&amp;diff=36933"/>
		<updated>2008-06-01T12:32:35Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added thoughts on content-addressable storage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some quick questions to avoid forgetting them:&lt;br /&gt;
&lt;br /&gt;
1) Will them be under the control of FileAPI (or, as they are now, fixed local storage)?&lt;br /&gt;
&lt;br /&gt;
- dataroot/temp&lt;br /&gt;
- dataroot/lang&lt;br /&gt;
- dataroot/cache&lt;br /&gt;
- dataroot/environment&lt;br /&gt;
- dataroot/filter&lt;br /&gt;
- dataroot/rss&lt;br /&gt;
- dataroot/search&lt;br /&gt;
- dataroot/sessions&lt;br /&gt;
- dataroot/upgradelogs&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : I don&#039;t see these as being in the API - I&#039;ve updated the spec.&lt;br /&gt;
&lt;br /&gt;
2) Assuming we&#039;ll have a cool OOP FileAPI... &lt;br /&gt;
&lt;br /&gt;
- a) Will it support different FileAPI classes (to be able to store in other systems) ?&lt;br /&gt;
- b) Will it support multiple FileAPI classes working together (like the Repo) ?&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : Hmm, I suppose it makes sense to switch the backend from local file storage to specify something else (eg database storage) but multiple File storage places doesn&#039;t make sense to me, that is the Repository API and the Portfolio API.  &lt;br /&gt;
&lt;br /&gt;
3) I&#039;ve annotated in red some things that have sounded strange in my first look.&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : Thanks, all fixed.  &lt;br /&gt;
&lt;br /&gt;
4) Are we going to have &amp;quot;directory records&amp;quot; in the implementation, or that is going to be handled exclusively by the &amp;quot;moodlepath&amp;quot; column?&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : Good point.  I was thinking of moodlepath only but I wonder if directory records might be more efficient.  New table, I guess.&lt;br /&gt;
&lt;br /&gt;
5) One general question... are we going to &amp;quot;force&amp;quot; all modules to be &amp;quot;autocontained&amp;quot; ? How are we going to handle resources, for example (with all those css, links, images..). In general how are we going to handle multiple-file packages?&lt;br /&gt;
&lt;br /&gt;
[[User:Martin Dougiamas|Martin Dougiamas]] 03:20, 28 April 2008 (CDT) : they&#039;ll be a set of files, probably in a &amp;quot;directory&amp;quot; specified by moodlepath of directory record.  What problems do you see?  Should we retain better knowledge of the original group of files?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That&#039;s all for now, ciao4niao :-) [[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 21:27, 5 April 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making Storage &#039;content addressable&#039; ==&lt;br /&gt;
One opportunity  which this API opens up is the possibility of making the actual storage of files &#039;content addressable&#039; . That is, if two users upload the same image for example, only store this file once on disk. This  brings benefits in reducing the amount of storage and improving caching (especially in increasingly common situations the moodle data store served from a NFS directory or other remote storage similar). To do this we could use a hash like sha-1 on the file and store the file on disk named by its hash (rather than some arbitary id). Then when someone uploads the same file as has already been uploaded, the hash matches and we just point the database record to the same file on disk. This technique is increasingly being used by enterprise-style repositories as well as things like git. I can see the major benefits in things like scorm packages other such things which have 100&#039;s of small duplicate files stored multiple times per package and course, so sometimes you can have the same image file stored 20 different times across 20 different packages in one course, which is then duplicated for multiple classes etcetc. --[[User:Dan Poltawski|Dan Poltawski]] 07:32, 1 June 2008 (CDT)&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=SF_Developer_HackFest&amp;diff=36914</id>
		<title>SF Developer HackFest</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=SF_Developer_HackFest&amp;diff=36914"/>
		<updated>2008-05-30T18:14:37Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: Adding an idea..&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Developer meetings]] &amp;gt; San Francisco 2008 Developer HackFest&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Date: 9am - 5pm Monday 9th June 2008 - see the [http://moodle.org/calendar/view.php?view=day&amp;amp;course=5&amp;amp;cal_d=9&amp;amp;cal_m=6&amp;amp;cal_y=2008 San Francisco 2008 Developer HackFest calendar entry] for conversion into your time zone&lt;br /&gt;
*Location: [http://www.grosvenorsfo.com/ Best Western Grosvenor Hotel], San Francisco&lt;br /&gt;
*Online location: [http://elluminate.remote-learner.net/join_meeting.html?meetingId=1176914355734 Elluminate Moodle Developers Meeting Room] - login using your actual name as login name and password &#039;&#039;moodle&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Developers and anyone wishing to become a Moodle developer can share code and ideas, and help shape the future of Moodle. This event is FREE, thanks to the sponsor [http://www.remote-learner.net/ Remote-Learner.net].&lt;br /&gt;
&lt;br /&gt;
Everyone is welcome, either in person or online :-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please add items to the agenda!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Moodle 2.0==&lt;br /&gt;
*[[Roadmap]] run-down (Martin)&lt;br /&gt;
&lt;br /&gt;
==Gradebook Interface Improvements==&lt;br /&gt;
*Overview of community feedback on 1.9 gradebook (Nicolas Connault)&lt;br /&gt;
*Run-down of current development&lt;br /&gt;
*Discussion of ideas for improvement, better defaults etc.&lt;br /&gt;
&lt;br /&gt;
==Other news==&lt;br /&gt;
&lt;br /&gt;
*[[GSOC/2008|Google Summer of Code 2008]] (Helen)&lt;br /&gt;
* I (Tim Hunt, OU Moodle developer and Moodle quiz module maintainer) will be there. I don&#039;t have anything in particular that I want to say, but I am very happy to talk about anything anyone else wants to cover that I know about.&lt;br /&gt;
&lt;br /&gt;
==Testing &amp;amp; QA==&lt;br /&gt;
&lt;br /&gt;
It might be good to have a general discussion on general testing/QA issues. Eg. bug triage, encouraging more testing/QA contributors, the weekly review etc. --[[User:Dan Poltawski|Dan Poltawski]] 13:14, 30 May 2008 (CDT)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Email_processing&amp;diff=34597</id>
		<title>Email processing</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Email_processing&amp;diff=34597"/>
		<updated>2008-04-05T16:02:20Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: /* Moodle configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Features ==&lt;br /&gt;
&lt;br /&gt;
Moodle now makes better use of the SMTP protocol and email in general. Most of the benefits result from using a technique known as Variable Envelope Return Path (VERP).&lt;br /&gt;
&lt;br /&gt;
* Works on most modern MTAs (at least on Unix systems).&lt;br /&gt;
* All processing of bounces and replies is secured using HMAC-MD5-8.&lt;br /&gt;
* Bounces are handled correctly and increase a &amp;quot;bad email&amp;quot; score for the user.&lt;br /&gt;
* noreply@host address is now on Reply-to field, avoiding accidental pollution of users address books.&lt;br /&gt;
* noreply@host has an autorresponder&lt;br /&gt;
* Makes it easy for modules to send emails with a signed VERP reply-to.&lt;br /&gt;
* Handles receving of VERP replies: Validates the HMAC-MD5-8 signature and Dispatches the encoded request data to the relevant module&lt;br /&gt;
&lt;br /&gt;
== Moodle configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit config.php to enable bounce handling, and setup Moodle to match your MTA configuration. Here&#039;s how. Uncomment these lines in config.php (if you cannot find them, copy them from config-dist.php):&lt;br /&gt;
&lt;br /&gt;
  // once handlebounces is true, we will be using VERP for the return address of every sent email&lt;br /&gt;
  $CFG-&amp;gt;handlebounces = true;&lt;br /&gt;
  // minimum bounces allowed per user&lt;br /&gt;
  $CFG-&amp;gt;minbounces = 10;&lt;br /&gt;
  // ratio of bad emails to sent emails&lt;br /&gt;
  // if we get more than 20% bounces &lt;br /&gt;
  // for a given user, his/her email is marked bad&lt;br /&gt;
  $CFG-&amp;gt;bounceratio = .20;&lt;br /&gt;
  // Prefix to identify your site MUST BE EXACTLY 3 characters&lt;br /&gt;
  $CFG-&amp;gt;mailprefix = &#039;mdl&#039;;&lt;br /&gt;
  // Domain which acccepts email for processing&lt;br /&gt;
  $CFG-&amp;gt;maildomain = &#039;bounces.my.domain&#039;;&lt;br /&gt;
&lt;br /&gt;
Edit the $CFG-&amp;gt;maildomain line and one of the $CFG-&amp;gt;mailprefix lines (the one that matches your MTA).&lt;br /&gt;
&lt;br /&gt;
Make sure your server has a command-line PHP interpreter, and that it is able to connect to mysql (or postgres if relevant). If you are able to run cron.php from the commandline or from crontab, this means PHP is ok.&lt;br /&gt;
&lt;br /&gt;
Edit the process_email.php script to point to the location of your php binary. It will usually be &#039;&#039;/usr/bin/php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Email confirmation or registration words, and how to edit them.==&lt;br /&gt;
*  Students receive a confirmation email when they create a user account.  This text can be found in the lang/?/moodle.php as the emailconfirmation &amp;quot;variable&amp;quot;.&lt;br /&gt;
* Students receive a welcome email when they enroll in a course.  This text can be found in the lang/?/moodle.php file as the welcometocoursetext &amp;quot;variable&amp;quot;.&lt;br /&gt;
*If you feel the need to edit this text, the best way to do this is to go to Site Administration -&amp;gt; Language editing, and then clicking on the string that you wish to edit. Once you have done this, hit the &amp;quot;Switch lang directory&amp;quot; button, and do your editing.&lt;br /&gt;
*If you decide to get your hands dirty and work by editing the moodle.php directly, be careful to open the file only in a simple text editor like notepad or wordpad. &lt;br /&gt;
*Tip: Be careful with markup - as you edit, you must use &amp;quot; &amp;quot; for things like putting in hyperlinks, titles and targets. You MUST &#039;escape&#039; them by putting a \ before each &amp;quot;. If you don&#039;t the resulting page will appear blank. For example, the normal way to markup a hyperlink is:-&lt;br /&gt;
**&amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;http://www.blah_blah&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt; If you do this in the moodle.php file, your edited text won&#039;t appear.&lt;br /&gt;
**Use &amp;lt;nowiki&amp;gt;&amp;lt;a href=\&amp;quot;http://www.blah_blah\&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*Use the \ before each &amp;quot; when marking up things like target=\&amp;quot;_blank\&amp;quot; and title=\&amp;quot;Blah blah\&amp;quot; and other similar codes.&lt;br /&gt;
*If you feel you must really go the route of editing the moodle.php file directly, save a copy of the file in its own folder (copy and paste the file in the same folder). That way, if it all goes wrong for you, all you have to do is delete the botched file and rename the &#039;copy of moodle.php&#039; back to &#039;moodle.php&#039; and you are back to square one, no harm done!&lt;br /&gt;
*Having said all that, it is best to do all your editing in the web interface by going to Site Administration -&amp;gt; Language editing, and then clicking on the string that you wish to edit.&lt;br /&gt;
[[Image:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup under Postfix ==&lt;br /&gt;
&lt;br /&gt;
Add a line to your aliases file. The line should list a 3-letter prefix, to which we&#039;ll add a &#039;|&#039;, and the path of the script. For example for a prefix of &#039;mdl&#039; and moodle installed under /var/www/moodle we have in aliases:&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you are using virtualdomains, consult your server administrator for the correct configuration. It probably involves editing transports and mapping your address to a &amp;quot;pipe&amp;quot; transport.&lt;br /&gt;
&lt;br /&gt;
== Setup under Qmail ==&lt;br /&gt;
&lt;br /&gt;
Depending on your setup, your aliases will be controlled by one or more of&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;/etc/aliases&#039;&#039;&lt;br /&gt;
* &#039;&#039;/var/qmail/alias/.qmail-PREFIX&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you edit /etc/aliases add a line like this (for a prefix of &#039;mdl&#039;):&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you create /var/qmail/alias/.qmail-PREFIX, just do&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;|/var/www/moodle/admin/process_email.php&amp;quot; &amp;gt; /var/qmail/alias/.qmail-mdl&lt;br /&gt;
  echo &amp;quot;|/var/www/moodle/admin/process_email.php&amp;quot; &amp;gt; /var/qmail/alias/.qmail-noreply&lt;br /&gt;
&lt;br /&gt;
To this three letter prefix, we will add a &#039;-&#039; when sending and receiving messages. For more info, check out the manpage for dot-qmail.&lt;br /&gt;
&lt;br /&gt;
== Setup under Exim ==&lt;br /&gt;
&lt;br /&gt;
Open &#039;&#039;/etc/exim/exim.conf&#039;&#039; and add to trusted_users the user Apache and cron.php run as (usually &amp;quot;www-data&amp;quot; or &amp;quot;nobody&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Add a line to your aliases file. The line should list a 3-letter prefix, to which we&#039;ll add a &#039;+&#039;, and the path of the script. For example for a prefix of &#039;mdl&#039; we have in aliases:&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you are using virtualdomains, consult your server administrator for the correct configuration. It probably involves editing transports and mapping your address to a &amp;quot;pipe&amp;quot; transport.&lt;br /&gt;
&lt;br /&gt;
More documentation about Exim can be found [http://www.exim.org/docs.html here]. &lt;br /&gt;
&lt;br /&gt;
You will probably have to tell Exim not to lowercase the local-part in your exim configuration. This can be done in the router which handles the mail for your aliases file with:&lt;br /&gt;
caseful_local_part = true&lt;br /&gt;
&lt;br /&gt;
== Developer info ==&lt;br /&gt;
&lt;br /&gt;
Changed functions:&lt;br /&gt;
&lt;br /&gt;
* email_to_user() will set the envelope sender to a special bounce processing address (based on $CFG settings)&lt;br /&gt;
* email_to_user() will accept (and set) a reply-to header, to be generated by the module calling the function.&lt;br /&gt;
* associated string changes/additions&lt;br /&gt;
&lt;br /&gt;
New functions:&lt;br /&gt;
&lt;br /&gt;
* generate_email_processing_address() - ALWAYS use this to generate the reply-to header. reply-to header will look like this: (LIMIT: 64 chars total) prefix - EXACTLY four chars encodeded, packed, moduleid (0 for core) (2 chars) up to 42 chars for the modules to put anything they want it (can contain userid (or, eg for forum, postids to reply to), or anything really. 42 chars is ABSOLUTE LIMIT) 16 char hash (half an md5) of the first part of the address, together with a site &amp;quot;secret&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* moodle_process_email() - any non-module email processing goes here (currently used for processing bounces)&lt;br /&gt;
&lt;br /&gt;
New files:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;admin/process_email.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This script needs to be called from your MTA for anything starting with the 3 char prefix described above (and optionally, the noreply address).&lt;br /&gt;
&lt;br /&gt;
How does it work? It will break down and unencode the email address into moduleid and validate the half md5 hash, and call $modname_process_email (if it exists). Arguments to these functions are: $modargs (any part of the email address that isn&#039;t the prefix, modid or the hash) and the contents of the email (read from STDIN).&lt;br /&gt;
&lt;br /&gt;
It doubles up as the noreplyaddress autorresponder if you configure it with that address as well. Replying with a friendly &amp;quot;this is not a real email address&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
== Module Authors ==&lt;br /&gt;
&lt;br /&gt;
Take a look at new functions moodle_process_email() and generate_email_processing_address() in moodlelib.php for ideas about how to&lt;br /&gt;
&lt;br /&gt;
* encode and unencode the arguments your module needs to do the processing&lt;br /&gt;
* how to deal with multiple &amp;quot;actions&amp;quot; for any given module.&lt;br /&gt;
&lt;br /&gt;
In a nutshell, users can send emails to Moodle using special dynamic addresses. These emails can trigger a call to a module function in the form of modulename_process_email($str, $bodyofemail). The $str part will be up to 42 characters of data generated by Moodle (presumably by your own module), and the $bodyofemailpart is the contents of the email (got by reading STDIN - usually generated by the users MUA).&lt;br /&gt;
&lt;br /&gt;
The 42 characters come from the &amp;quot;local part&amp;quot; of an email address (the part before the @ sign) which can have up to 64 chars. Out of those 64 chars, Moodle uses 22 characters, leaving you with 42 characters to encode data.&lt;br /&gt;
&lt;br /&gt;
What do we do with the 22 chars? Four go to the prefix, which we need to let the MTA know to pass the message to our script. Two go to identify the module ID so we know which module has generated the message (and so we dispatch the request to that module). The remaining 16 are a signature (HMAC-MD5-8) we use to authenticate the message.&lt;br /&gt;
&lt;br /&gt;
Forty-two characters isn&#039;t a lot (although it could be the answer to life, the universe, and everything!) so make sure you use those characters wisely.&lt;br /&gt;
&lt;br /&gt;
The most efficient way to encode database IDs in their full range (so that they can be placed in an email address) we have found is base64_encode(pack(&#039;V&#039;,2147483647)), which returns &amp;quot;/ / / / f w = =&amp;quot;. The two trailing &amp;quot;= =&amp;quot; are redundant and you can remove them (you&#039;ll need to reappend them when retrieving your data). Join your parameters as encoded IDs in positional slots for efficiency.&lt;br /&gt;
&lt;br /&gt;
To retrieve your data, use substr() to separate your parameters, and then unpack(&#039;V&#039;,base64_decode($str)). Note that it&#039;ll return a one-element array.&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
Using &#039;V&#039; reaches 2147483647, half the range of mySQL&#039;s INT. Additionally, &#039;V&#039; behaves like a signed value, rather than an unsigned, so I suspect there&#039;s a bug in PHP&#039;s documentation of pack().&lt;br /&gt;
&lt;br /&gt;
With each ID taking 6-chars (8 chars if we find a way to use the full range of &#039;V&#039;), you have a limited number of parameters. If you need to encode more information, store it in the DB and send emails that point to your stored data. Remember to cleanup this temporary data after a safe period of time.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
Do not try to use variable-width encoding to put IDs, as it&#039;ll work in small installations and break in larger ones.&lt;br /&gt;
&lt;br /&gt;
== Security issues ==&lt;br /&gt;
&lt;br /&gt;
Any code in modulename_process_email() _must_ assume it will see repeat replies and handle them gracefully. The definition of &#039;gracefully&#039; depends on what the code does.&lt;br /&gt;
&lt;br /&gt;
Email servers (MTAs) will sometimes re-transmit a message if they are unsure that the receiving MTA got it -- and sysadmins may sometimes replay a whole email queue if something&#039;s gone wrong. In that case, they email body will be identical, the headers slightly different.&lt;br /&gt;
&lt;br /&gt;
In a different case, the user may &#039;reply&#039; to the message twice. Perhaps in error, perhaps purposefully. What to do depends on the specific scenario.&lt;br /&gt;
&lt;br /&gt;
We /could/ support better protection at the framework level, by keeping track of every reply-to address we send out. We decided against that because (a) the performance impact will be important (b) we want the 1st cut to be lightweight and simple to change in case we need to.&lt;br /&gt;
&lt;br /&gt;
With this the initial implementation, modules should expose functions that handle these &amp;quot;replay&amp;quot; cases correctly. If later we want to expose additional functions, we can add such tracking as an optional thing. It&#039;d be awful to have it across all emails sent from Moodle.&lt;br /&gt;
&lt;br /&gt;
== Experimental email processing, pending merge into 1.9/2.0 ==&lt;br /&gt;
===Module Authors===&lt;br /&gt;
The email interface allows you to let users respond to emails sent via your module and affect change in them. The basic idea is that each email is uniquely identified with an email session that carries with it a simple payload. This payload is stored via database, and cannot be changed by the user. Replies are handled by module code in your lib.php library - modulename_process_email($payload, $body) - which is passed the session payload and the body (with full headers) of the email received, to be parsed as you like. Some utility functions are available as well to help with this.&lt;br /&gt;
&lt;br /&gt;
Here is an outline of the intended use:&lt;br /&gt;
* Before sending an email to a user via the email_to_user() function, the module should check to see if the config variable $CFG-&amp;gt;emailinterface is enabled. (This is off by default)&lt;br /&gt;
* Assuming the email interface is enabled, the function generate_email_verp_address($moduleid, $payload, $userid) should be called to create an &amp;quot;email session&amp;quot;. The payload should include any data you wish to use in your handling routine - such as the id of the user, or what part of the interface he is interacting with. The function will return a string containing the email session id.&lt;br /&gt;
* Call the email_to_user() function as normal, appending the email session id as the 11th parameter. Keep in mind that you will probably also need to change the text or html of the email to point out that the email interface is active.&lt;br /&gt;
* A function contained in the lib.php file of your module, named [modulename]_process_email($payload, $body) should be written. This is the handler function, which is called when an email reply is received. This function can inspect the contents of the payload received, then parse the email body for data. The $body parameter returns the full email, including the headers.&lt;br /&gt;
&lt;br /&gt;
Note that each email can only be replied to once - the email session is destroyed once an email has been received. If you wish to have multiple replies from a user, you will have to create a new session (and new email) every time. The email session table is also regularly pruned, the default settings allow sessions to persist for one month.&lt;br /&gt;
&lt;br /&gt;
The following utility functions are also defined in admin/process_email.php, which can help:&lt;br /&gt;
* get_email_subject($fullemail) - return the subject of an email&lt;br /&gt;
* strip_email_headers($fullemail) - strip all headers off an email&lt;br /&gt;
* email_is_multipart($fullemail) - determine if an email is a multipart message&lt;br /&gt;
* seperate_multipart($multipartmsg) - seperate a multipart email message into an array of parts, each of which has headers and a body.&lt;br /&gt;
* get_multipart_content_type($part) - determine the content-type of a multipart, generally text/plain or text/html.&lt;br /&gt;
* multipart_is_quoted_printable($part) - determine if a email part has been encoded with the quoted-printable encoding - some email clients tend to do this to html.&lt;br /&gt;
* decode_quoted_printable($partdata) - decode a email that has been encoded with quoted-printable encoding - this needs to be run on the data section of a part (strip_email_headers can be used to seperate the headers of a part).&lt;br /&gt;
* strip_email_reply($body, $ishtml, $identifier) - strip all irrelevant lines of an email message based on a unique identifier embedded within the original message. This is used to determine what is user input, and what is irrelevant data the email client has added.&lt;br /&gt;
* strip_email_reply_multi($body, $ishtml, $identifier) - as above, but allowing for multiple sections of possible user input in a single email message.&lt;br /&gt;
&lt;br /&gt;
Examples of use of these functions can be seen in the handler for the forum module. The idea behind the strip reply functions is that the original email will contain a unique identifier, such as a random 10 character string. This is embedded in a line with instructions for the user to write below and above it, e.g:&lt;br /&gt;
  \/ Please put your response here [ABCDEFGHIJ] \/&lt;br /&gt;
  &amp;lt;User Data&amp;gt;&lt;br /&gt;
  /\ Please put your response here [ABCDEFGHIJ] /\&lt;br /&gt;
This is necessary because of the wide differences between webmail and email clients in handling quotes and prefixing dates/times to replied emails. Keep in mind that text emails have an 80-character line width restrictions, which must also include the quote added by the email client, so any line of a text-email with this identifier should be kept to at least 77 characters to avoid wrapping by an email client. This unique identifier can be easily stored in the payload. Multiple input sections are handled similarly - a number is appended to the end of the identifier, e.g. [ABCDEFGHIJ1] to signfiy the first section of input. The strip_email_reply_multi returns an array containing a map from each numbered section it finds to a string containing all data in that section.&lt;br /&gt;
&lt;br /&gt;
===Developer Info===&lt;br /&gt;
The reply-to header is now encoded in base32 instead of base64 to allow for case-insensitive MTA&#039;s. Generate_email_processing_address was left as a backwards-compatibility wrapper, modules should use generate_email_verp_address now instead.&lt;br /&gt;
&lt;br /&gt;
Email sessions have been created to deal with the lack of space avaliable in the header under base32, payloads are stored in a new table mdl_email_sessions, and are identified with a unique base32 key which is embedded in the reply-to header. Each row has a timestamp, and the table is pruned during cleanup cron in admin/cron.php.&lt;br /&gt;
&lt;br /&gt;
Bounce detection is now linked in with the email interface - bounce detection is included in admin/process_email.php. Some new configuration variables have also been created to help configure these changes - $CFG-&amp;gt;emailinterface and $CFG-&amp;gt;emailsessiontime - and both have been added to the server settings admin page.&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Email_processing&amp;diff=34596</id>
		<title>Email processing</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Email_processing&amp;diff=34596"/>
		<updated>2008-04-05T15:20:03Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: added exim configuration option for keeping case in local part&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Features ==&lt;br /&gt;
&lt;br /&gt;
Moodle now makes better use of the SMTP protocol and email in general. Most of the benefits result from using a technique known as Variable Envelope Return Path (VERP).&lt;br /&gt;
&lt;br /&gt;
* Works on most modern MTAs (at least on Unix systems).&lt;br /&gt;
* All processing of bounces and replies is secured using HMAC-MD5-8.&lt;br /&gt;
* Bounces are handled correctly and increase a &amp;quot;bad email&amp;quot; score for the user.&lt;br /&gt;
* noreply@host address is now on Reply-to field, avoiding accidental pollution of users address books.&lt;br /&gt;
* noreply@host has an autorresponder&lt;br /&gt;
* Makes it easy for modules to send emails with a signed VERP reply-to.&lt;br /&gt;
* Handles receving of VERP replies: Validates the HMAC-MD5-8 signature and Dispatches the encoded request data to the relevant module&lt;br /&gt;
&lt;br /&gt;
== Moodle configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit config.php to enable bounce handling, and setup Moodle to match your MTA configuration. Here&#039;s how. Uncomment these lines in config.php (if you cannot find them, copy them from config-dist.php):&lt;br /&gt;
&lt;br /&gt;
  // once handlebounces is true, we will be using VERP for the return address of every sent email&lt;br /&gt;
  $CFG-&amp;gt;handlebounces = true;&lt;br /&gt;
  // minimum bounces allowed per user&lt;br /&gt;
  $CFG-&amp;gt;minbounces = 10;&lt;br /&gt;
  // ratio of bad emails to sent emails&lt;br /&gt;
  // if we get more than 20% bounces &lt;br /&gt;
  // for a given user, his/her email is marked bad&lt;br /&gt;
  $CFG-&amp;gt;bounceratio = .20;&lt;br /&gt;
  // Prefix to identify your site MUST BE EXACTLY 4 characters&lt;br /&gt;
  $CFG-&amp;gt;mailprefix = &#039;mdl1&#039;;&lt;br /&gt;
  // Domain which acccepts email for processing&lt;br /&gt;
  $CFG-&amp;gt;maildomain = &#039;bounces.my.domain&#039;;&lt;br /&gt;
&lt;br /&gt;
Edit the $CFG-&amp;gt;maildomain line and one of the $CFG-&amp;gt;mailprefix lines (the one that matches your MTA).&lt;br /&gt;
&lt;br /&gt;
Make sure your server has a command-line PHP interpreter, and that it is able to connect to mysql (or postgres if relevant). If you are able to run cron.php from the commandline or from crontab, this means PHP is ok.&lt;br /&gt;
&lt;br /&gt;
Edit the process_email.php script to point to the location of your php binary. It will usually be &#039;&#039;/usr/bin/php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Email confirmation or registration words, and how to edit them.==&lt;br /&gt;
*  Students receive a confirmation email when they create a user account.  This text can be found in the lang/?/moodle.php as the emailconfirmation &amp;quot;variable&amp;quot;.&lt;br /&gt;
* Students receive a welcome email when they enroll in a course.  This text can be found in the lang/?/moodle.php file as the welcometocoursetext &amp;quot;variable&amp;quot;.&lt;br /&gt;
*If you feel the need to edit this text, the best way to do this is to go to Site Administration -&amp;gt; Language editing, and then clicking on the string that you wish to edit. Once you have done this, hit the &amp;quot;Switch lang directory&amp;quot; button, and do your editing.&lt;br /&gt;
*If you decide to get your hands dirty and work by editing the moodle.php directly, be careful to open the file only in a simple text editor like notepad or wordpad. &lt;br /&gt;
*Tip: Be careful with markup - as you edit, you must use &amp;quot; &amp;quot; for things like putting in hyperlinks, titles and targets. You MUST &#039;escape&#039; them by putting a \ before each &amp;quot;. If you don&#039;t the resulting page will appear blank. For example, the normal way to markup a hyperlink is:-&lt;br /&gt;
**&amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;http://www.blah_blah&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt; If you do this in the moodle.php file, your edited text won&#039;t appear.&lt;br /&gt;
**Use &amp;lt;nowiki&amp;gt;&amp;lt;a href=\&amp;quot;http://www.blah_blah\&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*Use the \ before each &amp;quot; when marking up things like target=\&amp;quot;_blank\&amp;quot; and title=\&amp;quot;Blah blah\&amp;quot; and other similar codes.&lt;br /&gt;
*If you feel you must really go the route of editing the moodle.php file directly, save a copy of the file in its own folder (copy and paste the file in the same folder). That way, if it all goes wrong for you, all you have to do is delete the botched file and rename the &#039;copy of moodle.php&#039; back to &#039;moodle.php&#039; and you are back to square one, no harm done!&lt;br /&gt;
*Having said all that, it is best to do all your editing in the web interface by going to Site Administration -&amp;gt; Language editing, and then clicking on the string that you wish to edit.&lt;br /&gt;
[[Image:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup under Postfix ==&lt;br /&gt;
&lt;br /&gt;
Add a line to your aliases file. The line should list a 3-letter prefix, to which we&#039;ll add a &#039;|&#039;, and the path of the script. For example for a prefix of &#039;mdl&#039; and moodle installed under /var/www/moodle we have in aliases:&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you are using virtualdomains, consult your server administrator for the correct configuration. It probably involves editing transports and mapping your address to a &amp;quot;pipe&amp;quot; transport.&lt;br /&gt;
&lt;br /&gt;
== Setup under Qmail ==&lt;br /&gt;
&lt;br /&gt;
Depending on your setup, your aliases will be controlled by one or more of&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;/etc/aliases&#039;&#039;&lt;br /&gt;
* &#039;&#039;/var/qmail/alias/.qmail-PREFIX&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you edit /etc/aliases add a line like this (for a prefix of &#039;mdl&#039;):&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you create /var/qmail/alias/.qmail-PREFIX, just do&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;|/var/www/moodle/admin/process_email.php&amp;quot; &amp;gt; /var/qmail/alias/.qmail-mdl&lt;br /&gt;
  echo &amp;quot;|/var/www/moodle/admin/process_email.php&amp;quot; &amp;gt; /var/qmail/alias/.qmail-noreply&lt;br /&gt;
&lt;br /&gt;
To this three letter prefix, we will add a &#039;-&#039; when sending and receiving messages. For more info, check out the manpage for dot-qmail.&lt;br /&gt;
&lt;br /&gt;
== Setup under Exim ==&lt;br /&gt;
&lt;br /&gt;
Open &#039;&#039;/etc/exim/exim.conf&#039;&#039; and add to trusted_users the user Apache and cron.php run as (usually &amp;quot;www-data&amp;quot; or &amp;quot;nobody&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Add a line to your aliases file. The line should list a 3-letter prefix, to which we&#039;ll add a &#039;+&#039;, and the path of the script. For example for a prefix of &#039;mdl&#039; we have in aliases:&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you are using virtualdomains, consult your server administrator for the correct configuration. It probably involves editing transports and mapping your address to a &amp;quot;pipe&amp;quot; transport.&lt;br /&gt;
&lt;br /&gt;
More documentation about Exim can be found [http://www.exim.org/docs.html here]. &lt;br /&gt;
&lt;br /&gt;
You will probably have to tell Exim not to lowercase the local-part in your exim configuration. This can be done in the router which handles the mail for your aliases file with:&lt;br /&gt;
caseful_local_part = true&lt;br /&gt;
&lt;br /&gt;
== Developer info ==&lt;br /&gt;
&lt;br /&gt;
Changed functions:&lt;br /&gt;
&lt;br /&gt;
* email_to_user() will set the envelope sender to a special bounce processing address (based on $CFG settings)&lt;br /&gt;
* email_to_user() will accept (and set) a reply-to header, to be generated by the module calling the function.&lt;br /&gt;
* associated string changes/additions&lt;br /&gt;
&lt;br /&gt;
New functions:&lt;br /&gt;
&lt;br /&gt;
* generate_email_processing_address() - ALWAYS use this to generate the reply-to header. reply-to header will look like this: (LIMIT: 64 chars total) prefix - EXACTLY four chars encodeded, packed, moduleid (0 for core) (2 chars) up to 42 chars for the modules to put anything they want it (can contain userid (or, eg for forum, postids to reply to), or anything really. 42 chars is ABSOLUTE LIMIT) 16 char hash (half an md5) of the first part of the address, together with a site &amp;quot;secret&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* moodle_process_email() - any non-module email processing goes here (currently used for processing bounces)&lt;br /&gt;
&lt;br /&gt;
New files:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;admin/process_email.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This script needs to be called from your MTA for anything starting with the 3 char prefix described above (and optionally, the noreply address).&lt;br /&gt;
&lt;br /&gt;
How does it work? It will break down and unencode the email address into moduleid and validate the half md5 hash, and call $modname_process_email (if it exists). Arguments to these functions are: $modargs (any part of the email address that isn&#039;t the prefix, modid or the hash) and the contents of the email (read from STDIN).&lt;br /&gt;
&lt;br /&gt;
It doubles up as the noreplyaddress autorresponder if you configure it with that address as well. Replying with a friendly &amp;quot;this is not a real email address&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
== Module Authors ==&lt;br /&gt;
&lt;br /&gt;
Take a look at new functions moodle_process_email() and generate_email_processing_address() in moodlelib.php for ideas about how to&lt;br /&gt;
&lt;br /&gt;
* encode and unencode the arguments your module needs to do the processing&lt;br /&gt;
* how to deal with multiple &amp;quot;actions&amp;quot; for any given module.&lt;br /&gt;
&lt;br /&gt;
In a nutshell, users can send emails to Moodle using special dynamic addresses. These emails can trigger a call to a module function in the form of modulename_process_email($str, $bodyofemail). The $str part will be up to 42 characters of data generated by Moodle (presumably by your own module), and the $bodyofemailpart is the contents of the email (got by reading STDIN - usually generated by the users MUA).&lt;br /&gt;
&lt;br /&gt;
The 42 characters come from the &amp;quot;local part&amp;quot; of an email address (the part before the @ sign) which can have up to 64 chars. Out of those 64 chars, Moodle uses 22 characters, leaving you with 42 characters to encode data.&lt;br /&gt;
&lt;br /&gt;
What do we do with the 22 chars? Four go to the prefix, which we need to let the MTA know to pass the message to our script. Two go to identify the module ID so we know which module has generated the message (and so we dispatch the request to that module). The remaining 16 are a signature (HMAC-MD5-8) we use to authenticate the message.&lt;br /&gt;
&lt;br /&gt;
Forty-two characters isn&#039;t a lot (although it could be the answer to life, the universe, and everything!) so make sure you use those characters wisely.&lt;br /&gt;
&lt;br /&gt;
The most efficient way to encode database IDs in their full range (so that they can be placed in an email address) we have found is base64_encode(pack(&#039;V&#039;,2147483647)), which returns &amp;quot;/ / / / f w = =&amp;quot;. The two trailing &amp;quot;= =&amp;quot; are redundant and you can remove them (you&#039;ll need to reappend them when retrieving your data). Join your parameters as encoded IDs in positional slots for efficiency.&lt;br /&gt;
&lt;br /&gt;
To retrieve your data, use substr() to separate your parameters, and then unpack(&#039;V&#039;,base64_decode($str)). Note that it&#039;ll return a one-element array.&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
Using &#039;V&#039; reaches 2147483647, half the range of mySQL&#039;s INT. Additionally, &#039;V&#039; behaves like a signed value, rather than an unsigned, so I suspect there&#039;s a bug in PHP&#039;s documentation of pack().&lt;br /&gt;
&lt;br /&gt;
With each ID taking 6-chars (8 chars if we find a way to use the full range of &#039;V&#039;), you have a limited number of parameters. If you need to encode more information, store it in the DB and send emails that point to your stored data. Remember to cleanup this temporary data after a safe period of time.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
Do not try to use variable-width encoding to put IDs, as it&#039;ll work in small installations and break in larger ones.&lt;br /&gt;
&lt;br /&gt;
== Security issues ==&lt;br /&gt;
&lt;br /&gt;
Any code in modulename_process_email() _must_ assume it will see repeat replies and handle them gracefully. The definition of &#039;gracefully&#039; depends on what the code does.&lt;br /&gt;
&lt;br /&gt;
Email servers (MTAs) will sometimes re-transmit a message if they are unsure that the receiving MTA got it -- and sysadmins may sometimes replay a whole email queue if something&#039;s gone wrong. In that case, they email body will be identical, the headers slightly different.&lt;br /&gt;
&lt;br /&gt;
In a different case, the user may &#039;reply&#039; to the message twice. Perhaps in error, perhaps purposefully. What to do depends on the specific scenario.&lt;br /&gt;
&lt;br /&gt;
We /could/ support better protection at the framework level, by keeping track of every reply-to address we send out. We decided against that because (a) the performance impact will be important (b) we want the 1st cut to be lightweight and simple to change in case we need to.&lt;br /&gt;
&lt;br /&gt;
With this the initial implementation, modules should expose functions that handle these &amp;quot;replay&amp;quot; cases correctly. If later we want to expose additional functions, we can add such tracking as an optional thing. It&#039;d be awful to have it across all emails sent from Moodle.&lt;br /&gt;
&lt;br /&gt;
== Experimental email processing, pending merge into 1.9/2.0 ==&lt;br /&gt;
===Module Authors===&lt;br /&gt;
The email interface allows you to let users respond to emails sent via your module and affect change in them. The basic idea is that each email is uniquely identified with an email session that carries with it a simple payload. This payload is stored via database, and cannot be changed by the user. Replies are handled by module code in your lib.php library - modulename_process_email($payload, $body) - which is passed the session payload and the body (with full headers) of the email received, to be parsed as you like. Some utility functions are available as well to help with this.&lt;br /&gt;
&lt;br /&gt;
Here is an outline of the intended use:&lt;br /&gt;
* Before sending an email to a user via the email_to_user() function, the module should check to see if the config variable $CFG-&amp;gt;emailinterface is enabled. (This is off by default)&lt;br /&gt;
* Assuming the email interface is enabled, the function generate_email_verp_address($moduleid, $payload, $userid) should be called to create an &amp;quot;email session&amp;quot;. The payload should include any data you wish to use in your handling routine - such as the id of the user, or what part of the interface he is interacting with. The function will return a string containing the email session id.&lt;br /&gt;
* Call the email_to_user() function as normal, appending the email session id as the 11th parameter. Keep in mind that you will probably also need to change the text or html of the email to point out that the email interface is active.&lt;br /&gt;
* A function contained in the lib.php file of your module, named [modulename]_process_email($payload, $body) should be written. This is the handler function, which is called when an email reply is received. This function can inspect the contents of the payload received, then parse the email body for data. The $body parameter returns the full email, including the headers.&lt;br /&gt;
&lt;br /&gt;
Note that each email can only be replied to once - the email session is destroyed once an email has been received. If you wish to have multiple replies from a user, you will have to create a new session (and new email) every time. The email session table is also regularly pruned, the default settings allow sessions to persist for one month.&lt;br /&gt;
&lt;br /&gt;
The following utility functions are also defined in admin/process_email.php, which can help:&lt;br /&gt;
* get_email_subject($fullemail) - return the subject of an email&lt;br /&gt;
* strip_email_headers($fullemail) - strip all headers off an email&lt;br /&gt;
* email_is_multipart($fullemail) - determine if an email is a multipart message&lt;br /&gt;
* seperate_multipart($multipartmsg) - seperate a multipart email message into an array of parts, each of which has headers and a body.&lt;br /&gt;
* get_multipart_content_type($part) - determine the content-type of a multipart, generally text/plain or text/html.&lt;br /&gt;
* multipart_is_quoted_printable($part) - determine if a email part has been encoded with the quoted-printable encoding - some email clients tend to do this to html.&lt;br /&gt;
* decode_quoted_printable($partdata) - decode a email that has been encoded with quoted-printable encoding - this needs to be run on the data section of a part (strip_email_headers can be used to seperate the headers of a part).&lt;br /&gt;
* strip_email_reply($body, $ishtml, $identifier) - strip all irrelevant lines of an email message based on a unique identifier embedded within the original message. This is used to determine what is user input, and what is irrelevant data the email client has added.&lt;br /&gt;
* strip_email_reply_multi($body, $ishtml, $identifier) - as above, but allowing for multiple sections of possible user input in a single email message.&lt;br /&gt;
&lt;br /&gt;
Examples of use of these functions can be seen in the handler for the forum module. The idea behind the strip reply functions is that the original email will contain a unique identifier, such as a random 10 character string. This is embedded in a line with instructions for the user to write below and above it, e.g:&lt;br /&gt;
  \/ Please put your response here [ABCDEFGHIJ] \/&lt;br /&gt;
  &amp;lt;User Data&amp;gt;&lt;br /&gt;
  /\ Please put your response here [ABCDEFGHIJ] /\&lt;br /&gt;
This is necessary because of the wide differences between webmail and email clients in handling quotes and prefixing dates/times to replied emails. Keep in mind that text emails have an 80-character line width restrictions, which must also include the quote added by the email client, so any line of a text-email with this identifier should be kept to at least 77 characters to avoid wrapping by an email client. This unique identifier can be easily stored in the payload. Multiple input sections are handled similarly - a number is appended to the end of the identifier, e.g. [ABCDEFGHIJ1] to signfiy the first section of input. The strip_email_reply_multi returns an array containing a map from each numbered section it finds to a string containing all data in that section.&lt;br /&gt;
&lt;br /&gt;
===Developer Info===&lt;br /&gt;
The reply-to header is now encoded in base32 instead of base64 to allow for case-insensitive MTA&#039;s. Generate_email_processing_address was left as a backwards-compatibility wrapper, modules should use generate_email_verp_address now instead.&lt;br /&gt;
&lt;br /&gt;
Email sessions have been created to deal with the lack of space avaliable in the header under base32, payloads are stored in a new table mdl_email_sessions, and are identified with a unique base32 key which is embedded in the reply-to header. Each row has a timestamp, and the table is pruned during cleanup cron in admin/cron.php.&lt;br /&gt;
&lt;br /&gt;
Bounce detection is now linked in with the email interface - bounce detection is included in admin/process_email.php. Some new configuration variables have also been created to help configure these changes - $CFG-&amp;gt;emailinterface and $CFG-&amp;gt;emailsessiontime - and both have been added to the server settings admin page.&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Email_processing&amp;diff=34595</id>
		<title>Email processing</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Email_processing&amp;diff=34595"/>
		<updated>2008-04-05T15:04:40Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: put example config options for malprefix/domain&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Features ==&lt;br /&gt;
&lt;br /&gt;
Moodle now makes better use of the SMTP protocol and email in general. Most of the benefits result from using a technique known as Variable Envelope Return Path (VERP).&lt;br /&gt;
&lt;br /&gt;
* Works on most modern MTAs (at least on Unix systems).&lt;br /&gt;
* All processing of bounces and replies is secured using HMAC-MD5-8.&lt;br /&gt;
* Bounces are handled correctly and increase a &amp;quot;bad email&amp;quot; score for the user.&lt;br /&gt;
* noreply@host address is now on Reply-to field, avoiding accidental pollution of users address books.&lt;br /&gt;
* noreply@host has an autorresponder&lt;br /&gt;
* Makes it easy for modules to send emails with a signed VERP reply-to.&lt;br /&gt;
* Handles receving of VERP replies: Validates the HMAC-MD5-8 signature and Dispatches the encoded request data to the relevant module&lt;br /&gt;
&lt;br /&gt;
== Moodle configuration ==&lt;br /&gt;
&lt;br /&gt;
Edit config.php to enable bounce handling, and setup Moodle to match your MTA configuration. Here&#039;s how. Uncomment these lines in config.php (if you cannot find them, copy them from config-dist.php):&lt;br /&gt;
&lt;br /&gt;
  // once handlebounces is true, we will be using VERP for the return address of every sent email&lt;br /&gt;
  $CFG-&amp;gt;handlebounces = true;&lt;br /&gt;
  // minimum bounces allowed per user&lt;br /&gt;
  $CFG-&amp;gt;minbounces = 10;&lt;br /&gt;
  // ratio of bad emails to sent emails&lt;br /&gt;
  // if we get more than 20% bounces &lt;br /&gt;
  // for a given user, his/her email is marked bad&lt;br /&gt;
  $CFG-&amp;gt;bounceratio = .20;&lt;br /&gt;
  // Prefix to identify your site MUST BE EXACTLY 4 characters&lt;br /&gt;
  $CFG-&amp;gt;mailprefix = &#039;mdl1&#039;;&lt;br /&gt;
  // Domain which acccepts email for processing&lt;br /&gt;
  $CFG-&amp;gt;maildomain = &#039;bounces.my.domain&#039;;&lt;br /&gt;
&lt;br /&gt;
Edit the $CFG-&amp;gt;maildomain line and one of the $CFG-&amp;gt;mailprefix lines (the one that matches your MTA).&lt;br /&gt;
&lt;br /&gt;
Make sure your server has a command-line PHP interpreter, and that it is able to connect to mysql (or postgres if relevant). If you are able to run cron.php from the commandline or from crontab, this means PHP is ok.&lt;br /&gt;
&lt;br /&gt;
Edit the process_email.php script to point to the location of your php binary. It will usually be &#039;&#039;/usr/bin/php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Email confirmation or registration words, and how to edit them.==&lt;br /&gt;
*  Students receive a confirmation email when they create a user account.  This text can be found in the lang/?/moodle.php as the emailconfirmation &amp;quot;variable&amp;quot;.&lt;br /&gt;
* Students receive a welcome email when they enroll in a course.  This text can be found in the lang/?/moodle.php file as the welcometocoursetext &amp;quot;variable&amp;quot;.&lt;br /&gt;
*If you feel the need to edit this text, the best way to do this is to go to Site Administration -&amp;gt; Language editing, and then clicking on the string that you wish to edit. Once you have done this, hit the &amp;quot;Switch lang directory&amp;quot; button, and do your editing.&lt;br /&gt;
*If you decide to get your hands dirty and work by editing the moodle.php directly, be careful to open the file only in a simple text editor like notepad or wordpad. &lt;br /&gt;
*Tip: Be careful with markup - as you edit, you must use &amp;quot; &amp;quot; for things like putting in hyperlinks, titles and targets. You MUST &#039;escape&#039; them by putting a \ before each &amp;quot;. If you don&#039;t the resulting page will appear blank. For example, the normal way to markup a hyperlink is:-&lt;br /&gt;
**&amp;lt;nowiki&amp;gt;&amp;lt;a href=&amp;quot;http://www.blah_blah&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt; If you do this in the moodle.php file, your edited text won&#039;t appear.&lt;br /&gt;
**Use &amp;lt;nowiki&amp;gt;&amp;lt;a href=\&amp;quot;http://www.blah_blah\&amp;quot;&amp;gt;click here&amp;lt;/a&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
*Use the \ before each &amp;quot; when marking up things like target=\&amp;quot;_blank\&amp;quot; and title=\&amp;quot;Blah blah\&amp;quot; and other similar codes.&lt;br /&gt;
*If you feel you must really go the route of editing the moodle.php file directly, save a copy of the file in its own folder (copy and paste the file in the same folder). That way, if it all goes wrong for you, all you have to do is delete the botched file and rename the &#039;copy of moodle.php&#039; back to &#039;moodle.php&#039; and you are back to square one, no harm done!&lt;br /&gt;
*Having said all that, it is best to do all your editing in the web interface by going to Site Administration -&amp;gt; Language editing, and then clicking on the string that you wish to edit.&lt;br /&gt;
[[Image:Example.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Setup under Postfix ==&lt;br /&gt;
&lt;br /&gt;
Add a line to your aliases file. The line should list a 3-letter prefix, to which we&#039;ll add a &#039;|&#039;, and the path of the script. For example for a prefix of &#039;mdl&#039; and moodle installed under /var/www/moodle we have in aliases:&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you are using virtualdomains, consult your server administrator for the correct configuration. It probably involves editing transports and mapping your address to a &amp;quot;pipe&amp;quot; transport.&lt;br /&gt;
&lt;br /&gt;
== Setup under Qmail ==&lt;br /&gt;
&lt;br /&gt;
Depending on your setup, your aliases will be controlled by one or more of&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;/etc/aliases&#039;&#039;&lt;br /&gt;
* &#039;&#039;/var/qmail/alias/.qmail-PREFIX&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you edit /etc/aliases add a line like this (for a prefix of &#039;mdl&#039;):&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you create /var/qmail/alias/.qmail-PREFIX, just do&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;|/var/www/moodle/admin/process_email.php&amp;quot; &amp;gt; /var/qmail/alias/.qmail-mdl&lt;br /&gt;
  echo &amp;quot;|/var/www/moodle/admin/process_email.php&amp;quot; &amp;gt; /var/qmail/alias/.qmail-noreply&lt;br /&gt;
&lt;br /&gt;
To this three letter prefix, we will add a &#039;-&#039; when sending and receiving messages. For more info, check out the manpage for dot-qmail.&lt;br /&gt;
&lt;br /&gt;
== Setup under Exim ==&lt;br /&gt;
&lt;br /&gt;
Open &#039;&#039;/etc/exim/exim.conf&#039;&#039; and add to trusted_users the user Apache and cron.php run as (usually &amp;quot;www-data&amp;quot; or &amp;quot;nobody&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Add a line to your aliases file. The line should list a 3-letter prefix, to which we&#039;ll add a &#039;+&#039;, and the path of the script. For example for a prefix of &#039;mdl&#039; we have in aliases:&lt;br /&gt;
&lt;br /&gt;
    mdl:     |/var/www/moodle/admin/process_email.php&lt;br /&gt;
    noreply: |/var/www/moodle/admin/process_email.php&lt;br /&gt;
&lt;br /&gt;
If you are using virtualdomains, consult your server administrator for the correct configuration. It probably involves editing transports and mapping your address to a &amp;quot;pipe&amp;quot; transport.&lt;br /&gt;
&lt;br /&gt;
More documentation about Exim can be found [http://www.exim.org/docs.html here]. You may have to tell Exim not to lowercase the local-part.&lt;br /&gt;
&lt;br /&gt;
== Developer info ==&lt;br /&gt;
&lt;br /&gt;
Changed functions:&lt;br /&gt;
&lt;br /&gt;
* email_to_user() will set the envelope sender to a special bounce processing address (based on $CFG settings)&lt;br /&gt;
* email_to_user() will accept (and set) a reply-to header, to be generated by the module calling the function.&lt;br /&gt;
* associated string changes/additions&lt;br /&gt;
&lt;br /&gt;
New functions:&lt;br /&gt;
&lt;br /&gt;
* generate_email_processing_address() - ALWAYS use this to generate the reply-to header. reply-to header will look like this: (LIMIT: 64 chars total) prefix - EXACTLY four chars encodeded, packed, moduleid (0 for core) (2 chars) up to 42 chars for the modules to put anything they want it (can contain userid (or, eg for forum, postids to reply to), or anything really. 42 chars is ABSOLUTE LIMIT) 16 char hash (half an md5) of the first part of the address, together with a site &amp;quot;secret&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* moodle_process_email() - any non-module email processing goes here (currently used for processing bounces)&lt;br /&gt;
&lt;br /&gt;
New files:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;admin/process_email.php&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This script needs to be called from your MTA for anything starting with the 3 char prefix described above (and optionally, the noreply address).&lt;br /&gt;
&lt;br /&gt;
How does it work? It will break down and unencode the email address into moduleid and validate the half md5 hash, and call $modname_process_email (if it exists). Arguments to these functions are: $modargs (any part of the email address that isn&#039;t the prefix, modid or the hash) and the contents of the email (read from STDIN).&lt;br /&gt;
&lt;br /&gt;
It doubles up as the noreplyaddress autorresponder if you configure it with that address as well. Replying with a friendly &amp;quot;this is not a real email address&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
== Module Authors ==&lt;br /&gt;
&lt;br /&gt;
Take a look at new functions moodle_process_email() and generate_email_processing_address() in moodlelib.php for ideas about how to&lt;br /&gt;
&lt;br /&gt;
* encode and unencode the arguments your module needs to do the processing&lt;br /&gt;
* how to deal with multiple &amp;quot;actions&amp;quot; for any given module.&lt;br /&gt;
&lt;br /&gt;
In a nutshell, users can send emails to Moodle using special dynamic addresses. These emails can trigger a call to a module function in the form of modulename_process_email($str, $bodyofemail). The $str part will be up to 42 characters of data generated by Moodle (presumably by your own module), and the $bodyofemailpart is the contents of the email (got by reading STDIN - usually generated by the users MUA).&lt;br /&gt;
&lt;br /&gt;
The 42 characters come from the &amp;quot;local part&amp;quot; of an email address (the part before the @ sign) which can have up to 64 chars. Out of those 64 chars, Moodle uses 22 characters, leaving you with 42 characters to encode data.&lt;br /&gt;
&lt;br /&gt;
What do we do with the 22 chars? Four go to the prefix, which we need to let the MTA know to pass the message to our script. Two go to identify the module ID so we know which module has generated the message (and so we dispatch the request to that module). The remaining 16 are a signature (HMAC-MD5-8) we use to authenticate the message.&lt;br /&gt;
&lt;br /&gt;
Forty-two characters isn&#039;t a lot (although it could be the answer to life, the universe, and everything!) so make sure you use those characters wisely.&lt;br /&gt;
&lt;br /&gt;
The most efficient way to encode database IDs in their full range (so that they can be placed in an email address) we have found is base64_encode(pack(&#039;V&#039;,2147483647)), which returns &amp;quot;/ / / / f w = =&amp;quot;. The two trailing &amp;quot;= =&amp;quot; are redundant and you can remove them (you&#039;ll need to reappend them when retrieving your data). Join your parameters as encoded IDs in positional slots for efficiency.&lt;br /&gt;
&lt;br /&gt;
To retrieve your data, use substr() to separate your parameters, and then unpack(&#039;V&#039;,base64_decode($str)). Note that it&#039;ll return a one-element array.&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
Using &#039;V&#039; reaches 2147483647, half the range of mySQL&#039;s INT. Additionally, &#039;V&#039; behaves like a signed value, rather than an unsigned, so I suspect there&#039;s a bug in PHP&#039;s documentation of pack().&lt;br /&gt;
&lt;br /&gt;
With each ID taking 6-chars (8 chars if we find a way to use the full range of &#039;V&#039;), you have a limited number of parameters. If you need to encode more information, store it in the DB and send emails that point to your stored data. Remember to cleanup this temporary data after a safe period of time.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
Do not try to use variable-width encoding to put IDs, as it&#039;ll work in small installations and break in larger ones.&lt;br /&gt;
&lt;br /&gt;
== Security issues ==&lt;br /&gt;
&lt;br /&gt;
Any code in modulename_process_email() _must_ assume it will see repeat replies and handle them gracefully. The definition of &#039;gracefully&#039; depends on what the code does.&lt;br /&gt;
&lt;br /&gt;
Email servers (MTAs) will sometimes re-transmit a message if they are unsure that the receiving MTA got it -- and sysadmins may sometimes replay a whole email queue if something&#039;s gone wrong. In that case, they email body will be identical, the headers slightly different.&lt;br /&gt;
&lt;br /&gt;
In a different case, the user may &#039;reply&#039; to the message twice. Perhaps in error, perhaps purposefully. What to do depends on the specific scenario.&lt;br /&gt;
&lt;br /&gt;
We /could/ support better protection at the framework level, by keeping track of every reply-to address we send out. We decided against that because (a) the performance impact will be important (b) we want the 1st cut to be lightweight and simple to change in case we need to.&lt;br /&gt;
&lt;br /&gt;
With this the initial implementation, modules should expose functions that handle these &amp;quot;replay&amp;quot; cases correctly. If later we want to expose additional functions, we can add such tracking as an optional thing. It&#039;d be awful to have it across all emails sent from Moodle.&lt;br /&gt;
&lt;br /&gt;
== Experimental email processing, pending merge into 1.9/2.0 ==&lt;br /&gt;
===Module Authors===&lt;br /&gt;
The email interface allows you to let users respond to emails sent via your module and affect change in them. The basic idea is that each email is uniquely identified with an email session that carries with it a simple payload. This payload is stored via database, and cannot be changed by the user. Replies are handled by module code in your lib.php library - modulename_process_email($payload, $body) - which is passed the session payload and the body (with full headers) of the email received, to be parsed as you like. Some utility functions are available as well to help with this.&lt;br /&gt;
&lt;br /&gt;
Here is an outline of the intended use:&lt;br /&gt;
* Before sending an email to a user via the email_to_user() function, the module should check to see if the config variable $CFG-&amp;gt;emailinterface is enabled. (This is off by default)&lt;br /&gt;
* Assuming the email interface is enabled, the function generate_email_verp_address($moduleid, $payload, $userid) should be called to create an &amp;quot;email session&amp;quot;. The payload should include any data you wish to use in your handling routine - such as the id of the user, or what part of the interface he is interacting with. The function will return a string containing the email session id.&lt;br /&gt;
* Call the email_to_user() function as normal, appending the email session id as the 11th parameter. Keep in mind that you will probably also need to change the text or html of the email to point out that the email interface is active.&lt;br /&gt;
* A function contained in the lib.php file of your module, named [modulename]_process_email($payload, $body) should be written. This is the handler function, which is called when an email reply is received. This function can inspect the contents of the payload received, then parse the email body for data. The $body parameter returns the full email, including the headers.&lt;br /&gt;
&lt;br /&gt;
Note that each email can only be replied to once - the email session is destroyed once an email has been received. If you wish to have multiple replies from a user, you will have to create a new session (and new email) every time. The email session table is also regularly pruned, the default settings allow sessions to persist for one month.&lt;br /&gt;
&lt;br /&gt;
The following utility functions are also defined in admin/process_email.php, which can help:&lt;br /&gt;
* get_email_subject($fullemail) - return the subject of an email&lt;br /&gt;
* strip_email_headers($fullemail) - strip all headers off an email&lt;br /&gt;
* email_is_multipart($fullemail) - determine if an email is a multipart message&lt;br /&gt;
* seperate_multipart($multipartmsg) - seperate a multipart email message into an array of parts, each of which has headers and a body.&lt;br /&gt;
* get_multipart_content_type($part) - determine the content-type of a multipart, generally text/plain or text/html.&lt;br /&gt;
* multipart_is_quoted_printable($part) - determine if a email part has been encoded with the quoted-printable encoding - some email clients tend to do this to html.&lt;br /&gt;
* decode_quoted_printable($partdata) - decode a email that has been encoded with quoted-printable encoding - this needs to be run on the data section of a part (strip_email_headers can be used to seperate the headers of a part).&lt;br /&gt;
* strip_email_reply($body, $ishtml, $identifier) - strip all irrelevant lines of an email message based on a unique identifier embedded within the original message. This is used to determine what is user input, and what is irrelevant data the email client has added.&lt;br /&gt;
* strip_email_reply_multi($body, $ishtml, $identifier) - as above, but allowing for multiple sections of possible user input in a single email message.&lt;br /&gt;
&lt;br /&gt;
Examples of use of these functions can be seen in the handler for the forum module. The idea behind the strip reply functions is that the original email will contain a unique identifier, such as a random 10 character string. This is embedded in a line with instructions for the user to write below and above it, e.g:&lt;br /&gt;
  \/ Please put your response here [ABCDEFGHIJ] \/&lt;br /&gt;
  &amp;lt;User Data&amp;gt;&lt;br /&gt;
  /\ Please put your response here [ABCDEFGHIJ] /\&lt;br /&gt;
This is necessary because of the wide differences between webmail and email clients in handling quotes and prefixing dates/times to replied emails. Keep in mind that text emails have an 80-character line width restrictions, which must also include the quote added by the email client, so any line of a text-email with this identifier should be kept to at least 77 characters to avoid wrapping by an email client. This unique identifier can be easily stored in the payload. Multiple input sections are handled similarly - a number is appended to the end of the identifier, e.g. [ABCDEFGHIJ1] to signfiy the first section of input. The strip_email_reply_multi returns an array containing a map from each numbered section it finds to a string containing all data in that section.&lt;br /&gt;
&lt;br /&gt;
===Developer Info===&lt;br /&gt;
The reply-to header is now encoded in base32 instead of base64 to allow for case-insensitive MTA&#039;s. Generate_email_processing_address was left as a backwards-compatibility wrapper, modules should use generate_email_verp_address now instead.&lt;br /&gt;
&lt;br /&gt;
Email sessions have been created to deal with the lack of space avaliable in the header under base32, payloads are stored in a new table mdl_email_sessions, and are identified with a unique base32 key which is embedded in the reply-to header. Each row has a timestamp, and the table is pruned during cleanup cron in admin/cron.php.&lt;br /&gt;
&lt;br /&gt;
Bounce detection is now linked in with the email interface - bounce detection is included in admin/process_email.php. Some new configuration variables have also been created to help configure these changes - $CFG-&amp;gt;emailinterface and $CFG-&amp;gt;emailsessiontime - and both have been added to the server settings admin page.&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Projects_for_new_developers&amp;diff=33934</id>
		<title>Projects for new developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Projects_for_new_developers&amp;diff=33934"/>
		<updated>2008-03-24T23:02:43Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: adding sqlite project, for the adventurous&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists possible student projects in Moodle, in particular suggestions for GSOC 2008 projects. &lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Potential GSOC students===&lt;br /&gt;
&lt;br /&gt;
Firstly, review the [http://code.google.com/p/google-summer-of-code/wiki/AdviceforStudents GSOC advice for students].&lt;br /&gt;
&lt;br /&gt;
You may choose a project from the list below and/or suggest your own project ideas. Please use the [http://moodle.org/mod/forum/view.php?id=7105 Moodle.org Student projects forum] for discussing project ideas.&lt;br /&gt;
&lt;br /&gt;
Student applications start on Monday 24th March 2008. See the [http://code.google.com/opensource/gsoc/2008/faqs.html#0.1_timeline GSOC timeline] for more information.&lt;br /&gt;
&lt;br /&gt;
===Potential mentors===&lt;br /&gt;
&lt;br /&gt;
Moodle developers willing to mentor a GSOC project, please suggest a new project under the heading &amp;quot;Ideas we&#039;re considering for GSOC&amp;quot; and/or add your name to an existing project. Contact [http://moodle.org/user/view.php?id=24152&amp;amp;course=5 Helen Foster] if you have any questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Useful links==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC]] - describing Moodle&#039;s involvement with Google in their Summer of Code program, including a list of GSOC projects from 2006 and 2007&lt;br /&gt;
* [http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&amp;amp;requestId=10512 Popular Requests] - Most voted-for enhancements and new feature requests in the tracker&lt;br /&gt;
&lt;br /&gt;
==GSOC suggested projects==&lt;br /&gt;
&lt;br /&gt;
Following a review, approved suggested projects which have mentors will be moved under this heading. &#039;&#039;More approved suggested projects coming soon!&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
=== Consuming RSS feeds ===&lt;br /&gt;
&lt;br /&gt;
RSS/Atom feeds are becoming an important technology on the web and so it&#039;s crucial that Moodle has good support for consuming these feeds for a variety of different uses. At present we generate [[RSS|RSS feeds]] for use by other applications, though only consume feeds in the [[RSS feeds block]]. It would be useful to have a core library which can take care of aggregating feeds (and the issues around it) and to provide them in a simple format for plugins and other core parts of Moodle to use.&lt;br /&gt;
&lt;br /&gt;
This project will involve creating a feed aggregation library which:&lt;br /&gt;
* Will consume most current aggregation technologies (RSS 0.90/1.0/2.0 /Atom etc)&lt;br /&gt;
* Will work behind a variety of web proxies &lt;br /&gt;
* Periodically aggregates and uses a caching mechanism (doesn&#039;t query remote server with every request)&lt;br /&gt;
* (Is probably based on an existing PHP framework)&lt;br /&gt;
&lt;br /&gt;
In order test this library, it will be necessary to refactor the RSS block to use it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor:&#039;&#039;&#039; [http://moodle.org/user/view.php?id=104159&amp;amp;course=5 Dan Poltawski]&lt;br /&gt;
&lt;br /&gt;
=== Secure RSS feeds ===&lt;br /&gt;
&lt;br /&gt;
Currently RSS is less than useful because:&lt;br /&gt;
* Either we can&#039;t publish private information to the outside world because it&#039;s too sensitive.&lt;br /&gt;
* We open up sensitive information to the outside world&lt;br /&gt;
&lt;br /&gt;
We should add codes to make the RSS URLs practically impossible to guess, much the same way as Google Calendar does it.&lt;br /&gt;
&lt;br /&gt;
* Overhaul all the RSS feeds in Moodle to make use of a long hash-like string in the URL for identification (Forums, Data etc).  We already have a mechanism for managing these, developed for the grade export reports, called user_key_login.&lt;br /&gt;
* Add RSS to other areas of Moodle such as the participants &amp;quot;last logins&amp;quot; and the activity logs.&lt;br /&gt;
* Explore/research other methods of opening up RSS in a safe way to the outside world.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor:&#039;&#039;&#039; [http://moodle.org/user/view.php?id=240338&amp;amp;course=5 Nicolas Connault]&lt;br /&gt;
&lt;br /&gt;
===New customisable theme===&lt;br /&gt;
&lt;br /&gt;
Creation of a new [[Themes|theme]] that includes a configuration page so that the theme can be easily edited directly via Moodle. The page would include:&lt;br /&gt;
&lt;br /&gt;
* Select a logo from the site files and/or interface to upload a file&lt;br /&gt;
* Several input fields to customise various CSS elements such as block headings, text colour, background colour, headings, header, footer, extra custom CSS etc.&lt;br /&gt;
* Select a parent theme&lt;br /&gt;
&lt;br /&gt;
Also include the option of an administrator setting the theme for the site with their particular configuration or allowing users to customise various elements of the theme.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor:&#039;&#039;&#039; [http://moodle.org/user/view.php?id=11995 Shane Elliott]&lt;br /&gt;
&lt;br /&gt;
==Ideas we&#039;re considering for GSOC==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please add your ideas for GSOC projects under this heading.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Following a review, approved suggested projects which have mentors will be moved under the heading &amp;quot;GSOC suggested projects&amp;quot; above. Please note that suggested projects require a mentor in order for them to be approved.&lt;br /&gt;
&lt;br /&gt;
=== Roles interface improvements ===&lt;br /&gt;
&lt;br /&gt;
Improve the roles editing interface by making it more dynamic and flexible.  You can use the YUI library for ajax if you like, but there must be a good fall-back interface too.   Some ideas include:&lt;br /&gt;
&lt;br /&gt;
* Improve the order of the capabilities and implement better grouping.&lt;br /&gt;
* Make the groups of capabilities collapsible to make it easier to &amp;quot;zoom in&amp;quot; to a particular section.&lt;br /&gt;
* Add floating tooltip help when you hover over any given capability.&lt;br /&gt;
* Experiment with an (alternate) interface seeing the roles all side-by-side for easier comparison/editing.&lt;br /&gt;
* Implement a roles backup and restore system to allow site administrators to distribute useful roles in the Moodle community (rather than having to describe the permissions setup)&lt;br /&gt;
* More clearly designate the scope of capabilities. Does the capability apply at the site, category, course, activity, or user to user levels.&lt;br /&gt;
* Analyse the problem carefully with feedback from the community for more ideas.&lt;br /&gt;
&lt;br /&gt;
===Integration with bibliographic systems such as Wikindx===&lt;br /&gt;
&lt;br /&gt;
Managing references and citing them is an important behaviour in university education and research. Bibliographic facilities are quite complicated and go beyond the capabilities of Moodle built-in technology (e.g. the database activity). Integrating Moodle with open-source bibliographic software such as [http://wikindx.sourceforge.net/ Wikindx] could much facilitate this practice within Moodle.&lt;br /&gt;
&lt;br /&gt;
Design and construct an integration with Wikindx (or other open-source bibliographic tools, if appropriate).&lt;br /&gt;
&lt;br /&gt;
Teachers should be able to easily refer to wikindx bibliography items throughout a Moodle course, and be able to:&lt;br /&gt;
&lt;br /&gt;
* Generate correctly-formatted in-place references (using standard styles e.g. Harvard, APA) for the commonly-cited reference types (e.g. journal article, book chapter, book). It may be possible to delegate the formatting directly to wikindx (since it already performs functions like these) rather than implementing a whole new set of logic in the Moodle integration.&lt;br /&gt;
** Possibly, allow some kind of direct searching of a wikindx database from within Moodle, so as to make it easier to refer to items&lt;br /&gt;
* Generate reading lists / bibliographies&lt;br /&gt;
* Allow export of the above into common machine-readable formats such as Bibtex or RIS. (Wikindx can perform this so again it&#039;s a question of hooking into, or expanding, wikindx functionality.)&lt;br /&gt;
&lt;br /&gt;
See also [[Development:Wikindx]] and [http://moodle.org/mod/forum/discuss.php?d=23022 this forum discussion] too&lt;br /&gt;
&lt;br /&gt;
===Implement CATs in Moodle===&lt;br /&gt;
&lt;br /&gt;
[http://www.amazon.com/Classroom-Assessment-Techniques-Handbook-Education/dp/1555425003/ This book] describes a number of assessment techniques that involve collaboration and group work, and therefore fit very well into Moodle&#039;s Social Constructivist philosophy. The book about using these techniques in the classroom, but at an conference I attended there was a talk by Jean Runyon and Thomas Gorecki from the College of Southern Maryland saying how well these techniques work online. &lt;br /&gt;
&lt;br /&gt;
Some of them just need a forum of something basic, but others would need to be done as a database module templates. Doing this would&lt;br /&gt;
&lt;br /&gt;
# Make Moodle an even better teaching tool.&lt;br /&gt;
# Provide some good exemplars of how to do interesting things with database templates.&lt;br /&gt;
# Possibly highlight limitations in the database template system, that would require improvements to the database module code to overcome.&lt;br /&gt;
# One of the outcomes of this project could be some really good &#039;How to write a database template&#039; tutorial, which would be very valuable to the community.&lt;br /&gt;
&lt;br /&gt;
This is my (Tim Hunt&#039;s) idea, but I would not be interested in mentoring it. It would need to be someone who knows all about the database module.&lt;br /&gt;
&lt;br /&gt;
=== Blog Assignment Type ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is it for?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Blogs are inherently user owned and driven by definition, however teachers would like to have a way to use blogs as assignments in their courses, comment, grade, etc.&lt;br /&gt;
&lt;br /&gt;
A solution to this conundrum would be a new Assignment type that makes it possible for a student to easily submit the link one of their blogs to an assignment in a course, and have that blog entry privately graded and commented on by the instructor of that course. The blog entry itself remains public along with all of the student&#039;s other blogs. The tool would provide a time filter in the Assignment, so that the instructor could limit the blog entry posting dates that will be accepted (both to ensure &#039;fresh&#039; entries and to keep the list of entries the student chooses short for frequent student bloggers).&lt;br /&gt;
&lt;br /&gt;
I suggest a blog assignment type that functions as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Teacher:&#039;&#039;&#039;&lt;br /&gt;
Teacher creates a blog assignment, this puts a grade in the gradebook and provides an assignment link for students to see.&lt;br /&gt;
&lt;br /&gt;
The teacher can configure options to allow a blog entry posted in the last X days to be used for the assignment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Students:&#039;&#039;&#039;&lt;br /&gt;
When students enter the assignment they see a drop down menu of all their current (blog entries posted in the last X days as chosen by the teacher) blog entries, and they choose one to satisfy the assignment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Assessment:&#039;&#039;&#039;&lt;br /&gt;
The teacher goes in to the Assignment, views the blogs that are linked from the assignment, leaves comments (the comments only show up to the student when they view the blog assignment), and gives a grade.&lt;br /&gt;
&lt;br /&gt;
The blog entries themselves stay on the student&#039;s blog, only the grades, links, and comments go in the assignment (optionally the assignment scrapes the student&#039;s blog and loads the full text in to store for backup and restore).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interested Student&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=27192&amp;amp;course=1 Joey Morwick]&lt;br /&gt;
&lt;br /&gt;
=== Moodle IDE ===&lt;br /&gt;
The objective of this project is to create a Moodle IDE based on Eclipse so that new developers can get to develop Moodle in less time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ideas&#039;&#039;&#039;&lt;br /&gt;
* First release: Eclipse + Plugins + Moodle splashscreen + CVS Configuration + Apache + MySQL + Moodle CVS code. All preconfigured and ready out of the box.&lt;br /&gt;
* Every X time, it checks for new versions of Moodle and packs it.&lt;br /&gt;
* Checkstyle plugin alike to follow Moodle Design Guidelines.&lt;br /&gt;
* Development help (can be wiki pages to navigate offline)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More mentors needed&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download (Old Version)&#039;&#039;&#039;: [http://mirrors.davidhorat.com/moodle/MoodleIDE-latest.zip MoodleIDE-latest]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92859 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Moodle Multisite ===&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to make Moodle able to manage several Moodle sites with just one source code. This will help administrators of several sites to centralize code upgrades and &#039;&#039;technical problems&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ideas&#039;&#039;&#039;&lt;br /&gt;
* config.php will be a proxy that executes the concrete config file depending on the current url.&lt;br /&gt;
* The concrete config file will be under the directory /config and will have an arbitrary name created by the user.&lt;br /&gt;
* Create an XML file with all the pairs URL(n)-ConfigFile(1).&lt;br /&gt;
* Every time this file changes, it should be created the config.php file cache (to speed up things).&lt;br /&gt;
* Develop a Web frontend to change this file, that can be just accessed by the super admin in every site.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92860 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Automatic Accessibility Checking ===&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to make a tool that can check Moodle´s accessibility automatically before realising a version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ideas&#039;&#039;&#039;&lt;br /&gt;
* Automatic Tool (see down)&lt;br /&gt;
* Create an example course which introduces every XHTML code of the Moodle application, in order to have a way to test it.&lt;br /&gt;
* Create a button called &amp;quot;Check XHTML&amp;quot; which will send the current page code to a validator.&lt;br /&gt;
** This button just helps to check if the current page is valid. Good for development purposes.&lt;br /&gt;
** This button will be (de)activated in the administration panel&lt;br /&gt;
** Keep in mind that this button will not pass the URL as a referer, but it will take all the code from the page and send it to the validation service&lt;br /&gt;
** This button can be used in other web applications&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Automatic Tool&#039;&#039;&#039;&lt;br /&gt;
* Create (or use an existing one) an automatic and easy to use tool that retrieves all the pages in a site until a concrete level (recursive calling it for each link)&lt;br /&gt;
** Use concrete user agent names&lt;br /&gt;
** Be able to store cookies in order to check it with a concrete user and password&lt;br /&gt;
* Plug each output to an automatic XHTML validator&lt;br /&gt;
** In the future we can plug in different validators: CSS, WCAG (what it can be checkable automatically), etc.&lt;br /&gt;
* Generate stats&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92861 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Moodle Usability Guidelines ===&lt;br /&gt;
The main objective of this project is to develop a usability guidelines and testing methods in order to have a real view of Moodle usage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Main tasks&#039;&#039;&#039;&lt;br /&gt;
* Research in the usability world to see which methods are most used and which are most reliable.&lt;br /&gt;
* Select the ones that are more appropriate for Moodle&lt;br /&gt;
* Create a usability guideline with the way to apply these methods for Moodle&lt;br /&gt;
* Try them with real world people (optional, although it would be very interesting)&lt;br /&gt;
* Analyse the results in order to extract conclusions of the current Moodle Usage&lt;br /&gt;
* Report the ways we could improve current Moodle Usability&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92862 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Moodle Target tracking + rewards/gifts===&lt;br /&gt;
&lt;br /&gt;
This one would suit a facebook enthusiast! The Facebook gifts system is very popular and an ideal motivator for students at school level. Moodle needs an equivalent.&lt;br /&gt;
&lt;br /&gt;
The aim is to develop a system for setting targets e.g. &#039;get at least 60% in this assignment/quiz/whatever&#039; and for reward credits to be awarded automatically when it is completed. These reward credits translate to a system of Gifts similar to Facebook ones (small images, akin to stickers, which can be bought for a small fee and sent to friends who then display them on their profile). Admins can control what the reward images are for their site, maybe having them in some sort of rank order of value, or having different ones with different meanings. There are several ways they could be implemented beyond that:&lt;br /&gt;
* Teachers could choose which rewards can be earned for a specific task. For example, there may be different rewards for forums and assignments&lt;br /&gt;
* Teachers may want to specify different rewards for different levels of performance on the same task&lt;br /&gt;
* Teachers decide how many points a certain target is worth and the students cash in those points for rewards of various values&lt;br /&gt;
* Teachers decide how many rewards a target is worth and students choose that many rewards. None are worth more than 1 point each, the only difference is the graphic.&lt;br /&gt;
Once students have rewards, they need a way of allocating them (presumably permanently) to their friends. A system for logically displaying them on the friend&#039;s profile page would be needed too and will need to take into account&lt;br /&gt;
* Students with only a few stickers given to them by friends will want them to maximise their display&lt;br /&gt;
* Students who are very popular with hundreds of stickers may need to groups of 10 similar ones substituted for a super-sticker to use less space&lt;br /&gt;
* Hovering over the sticker should give details of who awarded it and when and possibly a short message.&lt;br /&gt;
Additionally, the social rating/ranking that this achieves will have most effect when it is publicly visible in various places e.g. under forum avatars and maybe in the online users block as well as the user profile. &lt;br /&gt;
&lt;br /&gt;
Maybe this would sit well with the &#039;Friends&#039; part of last years GSOC social networking project if it were finished.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t offer to mentor in coding terms, but will help with ideas all I can. [[User:Matt Gibson|Matt Gibson]] 05:26, 4 March 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
Interested Student : Rajan Vaish ( GTALK/GMAIL:vaish.rajan@gmail.com, IRC: vaish)&lt;br /&gt;
&lt;br /&gt;
===Use of Video Material Effectively within Moodle===&lt;br /&gt;
&lt;br /&gt;
The main purpose of this module will be to get use of video content, most probably a lecture, in a more formal/controlled/effective way within Moodle.&lt;br /&gt;
&lt;br /&gt;
The main features of this module will be;&lt;br /&gt;
* Stream the video file (most probably in flv format)&lt;br /&gt;
** Should be able to stream by using multiple ways (e.x. FMS, Red5, lighttpd, etc..)&lt;br /&gt;
** Develop a front-end to configure the streaming server settings&lt;br /&gt;
** automatic media conversion (controlled by other Moodle settings like max file size, etc..)&lt;br /&gt;
* The teacher can give related notes, websites or other resources with the video&lt;br /&gt;
* The students can keep a note related to each video&lt;br /&gt;
* Share/view other student&#039;s notes (probably controlled by the teachers and/or students)&lt;br /&gt;
* Optionally assess the student notes and include them in the grade book &lt;br /&gt;
&lt;br /&gt;
The above list may expanded based on your views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty Level:&#039;&#039;&#039; Easy/Medium&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills Required:&#039;&#039;&#039;&lt;br /&gt;
* Familiarity with streaming servers like Red5 and video streaming in general.&lt;br /&gt;
* Should be able to install and configure required products (Moodle, Red5, lighttpd, etc..) in any OS (Windows, Linux, Mac, etc..)&lt;br /&gt;
* Understanding of UI design concepts.&lt;br /&gt;
* Familiarity with Moodle APIs and [[Developer_documentation |Developing Moodle in general]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92310 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;References&#039;&#039;&#039;&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?rid=931&amp;amp;page=102 FlashVideo]&lt;br /&gt;
* [http://osflash.org/red5 RED5 Open Source Streaming Server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Potential Mentor:&#039;&#039;&#039; [http://moodle.org/user/edit.php?id=68520 Rashan Anushka]&lt;br /&gt;
&lt;br /&gt;
===Web-based upgrade and plugins interface===&lt;br /&gt;
&lt;br /&gt;
A system for Moodle to be upgraded along with its plugins from within the admin interface.&lt;br /&gt;
&lt;br /&gt;
Currently, adding third party modules/patches can be messy and can especially slow down the upgrade process if CVS is not used. The aim would be to develop a way to package plugins in a standardised way so that a single zip file could be retrieved and installed automatically, similar to the way courses are restored. An added feature would be for the modules and plugins database on moodle.org to have an XML index so that you could browse available plugins from within your own moodle instance and have a one-click install option. Version compatibility info could be included so that only those which will work with your install will be shown. At upgrade time, the new third-party components screen could then show which ones could be upgraded along with the rest of the code and which would need to dropped because there is no compatible replacement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Add SQLite Support to XMLDB===&lt;br /&gt;
Having local sqlite database has been discussed in the past by developers for uses such as prototyping and testing. In this project you would add sqllite to the moodle database abstraction layer. Once this had been archieved you would look at adding a mechanism to copy a live moodle database into a sqllite database to implement a mechnism to switch into &#039;testing mode&#039; using a sqlite copy of the live database.  See also [http://moodle.org/mod/forum/discuss.php?d=88827 this thread on sqllite in moodle]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=92797 Simple Quiz building user interface] forum discussion about work that might be done this summer, although as part of something other than GSOC&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Projects_for_new_developers&amp;diff=33825</id>
		<title>Projects for new developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Projects_for_new_developers&amp;diff=33825"/>
		<updated>2008-03-20T11:01:41Z</updated>

		<summary type="html">&lt;p&gt;Poltawski: Added feed consumtion project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists possible student projects in Moodle, in particular suggestions for GSOC 2008 projects. &lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Potential GSOC students===&lt;br /&gt;
&lt;br /&gt;
Firstly, review the [http://code.google.com/p/google-summer-of-code/wiki/AdviceforStudents GSOC advice for students].&lt;br /&gt;
&lt;br /&gt;
You may choose a project from the list below and/or suggest your own project ideas. Please use the [http://moodle.org/mod/forum/view.php?id=7105 Moodle.org Student projects forum] for discussing project ideas.&lt;br /&gt;
&lt;br /&gt;
Student applications start on Monday 24th March 2008. See the [http://code.google.com/opensource/gsoc/2008/faqs.html#0.1_timeline GSOC timeline] for more information.&lt;br /&gt;
&lt;br /&gt;
===Potential mentors===&lt;br /&gt;
&lt;br /&gt;
Moodle developers willing to mentor a GSOC project, please suggest a new project under the heading &amp;quot;Ideas we&#039;re considering for GSOC&amp;quot; and/or add your name to an existing project. Contact [http://moodle.org/user/view.php?id=24152&amp;amp;course=5 Helen Foster] if you have any questions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
==Useful links==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC]] - describing Moodle&#039;s involvement with Google in their Summer of Code program, including a list of GSOC projects from 2006 and 2007&lt;br /&gt;
* [http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&amp;amp;requestId=10512 Popular Requests] - Most voted-for enhancements and new feature requests in the tracker&lt;br /&gt;
&lt;br /&gt;
==GSOC suggested projects==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;List of approved suggested projects coming soon!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Following a review, approved suggested projects which have mentors will be moved under this heading.&lt;br /&gt;
&lt;br /&gt;
==Ideas we&#039;re considering for GSOC==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please add your ideas for GSOC projects under this heading.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Following a review, approved suggested projects which have mentors will be moved under the heading &amp;quot;GSOC suggested projects&amp;quot; above. Please note that suggested projects require a mentor in order for them to be approved.&lt;br /&gt;
&lt;br /&gt;
=== Secure RSS feeds ===&lt;br /&gt;
&lt;br /&gt;
Currently RSS is less than useful because:&lt;br /&gt;
* Either we can&#039;t publish private information to the outside world because it&#039;s too sensitive.&lt;br /&gt;
* We open up sensitive information to the outside world&lt;br /&gt;
&lt;br /&gt;
We should add codes to make the RSS URLs practically impossible to guess, much the same way as Google Calendar does it.&lt;br /&gt;
&lt;br /&gt;
* Overhaul all the RSS feeds in Moodle to make use of a long hash-like string in the URL for identification (Forums, Data etc).&lt;br /&gt;
* Store these codes in a new field per-user and per-course.   &lt;br /&gt;
* Add GUIs to let the user recreate their code to something else should they suspect a breach.&lt;br /&gt;
* Add RSS to other areas of Moodle such as the participants &amp;quot;last logins&amp;quot; and the activity logs.&lt;br /&gt;
* Explore/research other methods of opening up RSS in a safe way to the outside world.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Old Specification:&#039;&#039;&#039; [[Student projects/Secure RSS feeds|Secure RSS feeds]]&lt;br /&gt;
&lt;br /&gt;
=== Consuming Feeds ===&lt;br /&gt;
&lt;br /&gt;
RSS/Atom feeds are becoming an important technology on the web and its crucial that Moodle has good support for consuming these feeds for a variety of different uses. At present we generate RSS feeds for use by other applications, but at only consume feeds in the RSS block. It would be useful to have a core library which can take care of aggreating feeds (and the issues around that) and provide them in a simple format for plugins and other core parts of Moodle to use.&lt;br /&gt;
&lt;br /&gt;
Create a feed aggregation library which:&lt;br /&gt;
* (Is probably based on an existing php framework)&lt;br /&gt;
* Will consume most current aggregation technologies (RSS 0.90/1.0/2.0 /Atom etc)&lt;br /&gt;
* Will work behind a variety of web proxies &lt;br /&gt;
* Periodically aggregates and uses a caching mechanism (doesn&#039;t query remote server with every request)&lt;br /&gt;
&lt;br /&gt;
In order test this library refactor the RSS block to use it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor:&#039;&#039;&#039; Dan Poltawski&lt;br /&gt;
&lt;br /&gt;
=== Roles interface improvements ===&lt;br /&gt;
&lt;br /&gt;
Improve the roles editing interface by making it more dynamic and flexible.  You can use the YUI library for ajax if you like, but there must be a good fall-back interface too.   Some ideas include:&lt;br /&gt;
&lt;br /&gt;
* Improve the order of the capabilities and implement better grouping.&lt;br /&gt;
* Make the groups of capabilities collapsible to make it easier to &amp;quot;zoom in&amp;quot; to a particular section.&lt;br /&gt;
* Add floating tooltip help when you hover over any given capability.&lt;br /&gt;
* Experiment with an (alternate) interface seeing the roles all side-by-side for easier comparison/editing.&lt;br /&gt;
* Implement a roles backup and restore system to allow site administrators to distribute useful roles in the Moodle community (rather than having to describe the permissions setup)&lt;br /&gt;
* More clearly designate the scope of capabilities. Does the capability apply at the site, category, course, activity, or user to user levels.&lt;br /&gt;
* Analyse the problem carefully with feedback from the community for more ideas.&lt;br /&gt;
&lt;br /&gt;
===Integration with bibliographic systems such as Wikindx===&lt;br /&gt;
&lt;br /&gt;
Managing references and citing them is an important behaviour in university education and research. Bibliographic facilities are quite complicated and go beyond the capabilities of Moodle built-in technology (e.g. the database activity). Integrating Moodle with open-source bibliographic software such as [http://wikindx.sourceforge.net/ Wikindx] could much facilitate this practice within Moodle.&lt;br /&gt;
&lt;br /&gt;
Design and construct an integration with Wikindx (or other open-source bibliographic tools, if appropriate).&lt;br /&gt;
&lt;br /&gt;
Teachers should be able to easily refer to wikindx bibliography items throughout a Moodle course, and be able to:&lt;br /&gt;
&lt;br /&gt;
* Generate correctly-formatted in-place references (using standard styles e.g. Harvard, APA) for the commonly-cited reference types (e.g. journal article, book chapter, book). It may be possible to delegate the formatting directly to wikindx (since it already performs functions like these) rather than implementing a whole new set of logic in the Moodle integration.&lt;br /&gt;
** Possibly, allow some kind of direct searching of a wikindx database from within Moodle, so as to make it easier to refer to items&lt;br /&gt;
* Generate reading lists / bibliographies&lt;br /&gt;
* Allow export of the above into common machine-readable formats such as Bibtex or RIS. (Wikindx can perform this so again it&#039;s a question of hooking into, or expanding, wikindx functionality.)&lt;br /&gt;
&lt;br /&gt;
See also [[Development:Wikindx]] and [http://moodle.org/mod/forum/discuss.php?d=23022 this forum discussion] too&lt;br /&gt;
&lt;br /&gt;
===Implement CATs in Moodle===&lt;br /&gt;
&lt;br /&gt;
[http://www.amazon.com/Classroom-Assessment-Techniques-Handbook-Education/dp/1555425003/ This book] describes a number of assessment techniques that involve collaboration and group work, and therefore fit very well into Moodle&#039;s Social Constructivist philosophy. The book about using these techniques in the classroom, but at an conference I attended there was a talk by Jean Runyon and Thomas Gorecki from the College of Southern Maryland saying how well these techniques work online. &lt;br /&gt;
&lt;br /&gt;
Some of them just need a forum of something basic, but others would need to be done as a database module templates. Doing this would&lt;br /&gt;
&lt;br /&gt;
# Make Moodle an even better teaching tool.&lt;br /&gt;
# Provide some good exemplars of how to do interesting things with database templates.&lt;br /&gt;
# Possibly highlight limitations in the database template system, that would require improvements to the database module code to overcome.&lt;br /&gt;
# One of the outcomes of this project could be some really good &#039;How to write a database template&#039; tutorial, which would be very valuable to the community.&lt;br /&gt;
&lt;br /&gt;
This is my (Tim Hunt&#039;s) idea, but I would not be interested in mentoring it. It would need to be someone who knows all about the database module.&lt;br /&gt;
&lt;br /&gt;
=== Blog Assignment Type ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What is it for?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Blogs are inherently user owned and driven by definition, however teachers would like to have a way to use blogs as assignments in their courses, comment, grade, etc.&lt;br /&gt;
&lt;br /&gt;
A solution to this conundrum would be a new Assignment type that makes it possible for a student to easily submit the link one of their blogs to an assignment in a course, and have that blog entry privately graded and commented on by the instructor of that course. The blog entry itself remains public along with all of the student&#039;s other blogs. The tool would provide a time filter in the Assignment, so that the instructor could limit the blog entry posting dates that will be accepted (both to ensure &#039;fresh&#039; entries and to keep the list of entries the student chooses short for frequent student bloggers).&lt;br /&gt;
&lt;br /&gt;
I suggest a blog assignment type that functions as follows:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Teacher:&#039;&#039;&#039;&lt;br /&gt;
Teacher creates a blog assignment, this puts a grade in the gradebook and provides an assignment link for students to see.&lt;br /&gt;
&lt;br /&gt;
The teacher can configure options to allow a blog entry posted in the last X days to be used for the assignment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Students:&#039;&#039;&#039;&lt;br /&gt;
When students enter the assignment they see a drop down menu of all their current (blog entries posted in the last X days as chosen by the teacher) blog entries, and they choose one to satisfy the assignment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Assessment:&#039;&#039;&#039;&lt;br /&gt;
The teacher goes in to the Assignment, views the blogs that are linked from the assignment, leaves comments (the comments only show up to the student when they view the blog assignment), and gives a grade.&lt;br /&gt;
&lt;br /&gt;
The blog entries themselves stay on the student&#039;s blog, only the grades, links, and comments go in the assignment (optionally the assignment scrapes the student&#039;s blog and loads the full text in to store for backup and restore).&lt;br /&gt;
&lt;br /&gt;
=== Moodle IDE ===&lt;br /&gt;
The objective of this project is to create a Moodle IDE based on Eclipse so that new developers can get to develop Moodle in less time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ideas&#039;&#039;&#039;&lt;br /&gt;
* First release: Eclipse + Plugins + Moodle splashscreen + CVS Configuration + Apache + MySQL + Moodle CVS code. All preconfigured and ready out of the box.&lt;br /&gt;
* Every X time, it checks for new versions of Moodle and packs it.&lt;br /&gt;
* Checkstyle plugin alike to follow Moodle Design Guidelines.&lt;br /&gt;
* Development help (can be wiki pages to navigate offline)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More mentors needed&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Download (Old Version)&#039;&#039;&#039;: [http://mirrors.davidhorat.com/moodle/MoodleIDE-latest.zip MoodleIDE-latest]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92859 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Moodle Multisite ===&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to make Moodle able to manage several Moodle sites with just one source code. This will help administrators of several sites to centralize code upgrades and &#039;&#039;technical problems&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ideas&#039;&#039;&#039;&lt;br /&gt;
* config.php will be a proxy that executes the concrete config file depending on the current url.&lt;br /&gt;
* The concrete config file will be under the directory /config and will have an arbitrary name created by the user.&lt;br /&gt;
* Create an XML file with all the pairs URL(n)-ConfigFile(1).&lt;br /&gt;
* Every time this file changes, it should be created the config.php file cache (to speed up things).&lt;br /&gt;
* Develop a Web frontend to change this file, that can be just accessed by the super admin in every site.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92860 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Automatic Accessibility Checking ===&lt;br /&gt;
&lt;br /&gt;
The objective of this project is to make a tool that can check Moodle´s accessibility automatically before realising a version.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ideas&#039;&#039;&#039;&lt;br /&gt;
* Automatic Tool (see down)&lt;br /&gt;
* Create an example course which introduces every XHTML code of the Moodle application, in order to have a way to test it.&lt;br /&gt;
* Create a button called &amp;quot;Check XHTML&amp;quot; which will send the current page code to a validator.&lt;br /&gt;
** This button just helps to check if the current page is valid. Good for development purposes.&lt;br /&gt;
** This button will be (de)activated in the administration panel&lt;br /&gt;
** Keep in mind that this button will not pass the URL as a referer, but it will take all the code from the page and send it to the validation service&lt;br /&gt;
** This button can be used in other web applications&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Automatic Tool&#039;&#039;&#039;&lt;br /&gt;
* Create (or use an existing one) an automatic and easy to use tool that retrieves all the pages in a site until a concrete level (recursive calling it for each link)&lt;br /&gt;
** Use concrete user agent names&lt;br /&gt;
** Be able to store cookies in order to check it with a concrete user and password&lt;br /&gt;
* Plug each output to an automatic XHTML validator&lt;br /&gt;
** In the future we can plug in different validators: CSS, WCAG (what it can be checkable automatically), etc.&lt;br /&gt;
* Generate stats&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92861 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Moodle Usability Guidelines ===&lt;br /&gt;
The main objective of this project is to develop a usability guidelines and testing methods in order to have a real view of Moodle usage.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Main tasks&#039;&#039;&#039;&lt;br /&gt;
* Research in the usability world to see which methods are most used and which are most reliable.&lt;br /&gt;
* Select the ones that are more appropriate for Moodle&lt;br /&gt;
* Create a usability guideline with the way to apply these methods for Moodle&lt;br /&gt;
* Try them with real world people (optional, although it would be very interesting)&lt;br /&gt;
* Analyse the results in order to extract conclusions of the current Moodle Usage&lt;br /&gt;
* Report the ways we could improve current Moodle Usability&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor&#039;&#039;&#039;:  [http://moodle.org/user/view.php?id=153093&amp;amp;course=1 David Horat]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92862 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Moodle Target tracking + rewards/gifts===&lt;br /&gt;
&lt;br /&gt;
This one would suit a facebook enthusiast! The Facebook gifts system is very popular and an ideal motivator for students at school level. Moodle needs an equivalent.&lt;br /&gt;
&lt;br /&gt;
The aim is to develop a system for setting targets e.g. &#039;get at least 60% in this assignment/quiz/whatever&#039; and for reward credits to be awarded automatically when it is completed. These reward credits translate to a system of Gifts similar to Facebook ones (small images, akin to stickers, which can be bought for a small fee and sent to friends who then display them on their profile). Admins can control what the reward images are for their site, maybe having them in some sort of rank order of value, or having different ones with different meanings. There are several ways they could be implemented beyond that:&lt;br /&gt;
* Teachers could choose which rewards can be earned for a specific task. For example, there may be different rewards for forums and assignments&lt;br /&gt;
* Teachers may want to specify different rewards for different levels of performance on the same task&lt;br /&gt;
* Teachers decide how many points a certain target is worth and the students cash in those points for rewards of various values&lt;br /&gt;
* Teachers decide how many rewards a target is worth and students choose that many rewards. None are worth more than 1 point each, the only difference is the graphic.&lt;br /&gt;
Once students have rewards, they need a way of allocating them (presumably permanently) to their friends. A system for logically displaying them on the friend&#039;s profile page would be needed too and will need to take into account&lt;br /&gt;
* Students with only a few stickers given to them by friends will want them to maximise their display&lt;br /&gt;
* Students who are very popular with hundreds of stickers may need to groups of 10 similar ones substituted for a super-sticker to use less space&lt;br /&gt;
* Hovering over the sticker should give details of who awarded it and when and possibly a short message.&lt;br /&gt;
Additionally, the social rating/ranking that this achieves will have most effect when it is publicly visible in various places e.g. under forum avatars and maybe in the online users block as well as the user profile. &lt;br /&gt;
&lt;br /&gt;
Maybe this would sit well with the &#039;Friends&#039; part of last years GSOC social networking project if it were finished.&lt;br /&gt;
&lt;br /&gt;
I can&#039;t offer to mentor in coding terms, but will help with ideas all I can. [[User:Matt Gibson|Matt Gibson]] 05:26, 4 March 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
Interested Student : Rajan Vaish ( GTALK/GMAIL:vaish.rajan@gmail.com, IRC: vaish)&lt;br /&gt;
&lt;br /&gt;
===Use of Video Material Effectively within Moodle===&lt;br /&gt;
&lt;br /&gt;
The main purpose of this module will be to get use of video content, most probably a lecture, in a more formal/controlled/effective way within Moodle.&lt;br /&gt;
&lt;br /&gt;
The main features of this module will be;&lt;br /&gt;
* Stream the video file (most probably in flv format)&lt;br /&gt;
** Should be able to stream by using multiple ways (e.x. FMS, Red5, lighttpd, etc..)&lt;br /&gt;
** Develop a front-end to configure the streaming server settings&lt;br /&gt;
** automatic media conversion (controlled by other Moodle settings like max file size, etc..)&lt;br /&gt;
* The teacher can give related notes, websites or other resources with the video&lt;br /&gt;
* The students can keep a note related to each video&lt;br /&gt;
* Share/view other student&#039;s notes (probably controlled by the teachers and/or students)&lt;br /&gt;
* Optionally assess the student notes and include them in the grade book &lt;br /&gt;
&lt;br /&gt;
The above list may expanded based on your views.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Difficulty Level:&#039;&#039;&#039; Easy/Medium&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Skills Required:&#039;&#039;&#039;&lt;br /&gt;
* Familiarity with streaming servers like Red5 and video streaming in general.&lt;br /&gt;
* Should be able to install and configure required products (Moodle, Red5, lighttpd, etc..) in any OS (Windows, Linux, Mac, etc..)&lt;br /&gt;
* Understanding of UI design concepts.&lt;br /&gt;
* Familiarity with Moodle APIs and [[Developer_documentation |Developing Moodle in general]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Join the [http://moodle.org/mod/forum/discuss.php?d=92310 discussion thread]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;References&#039;&#039;&#039;&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?rid=931&amp;amp;page=102 FlashVideo]&lt;br /&gt;
* [http://osflash.org/red5 RED5 Open Source Streaming Server]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Potential Mentor:&#039;&#039;&#039; [http://moodle.org/user/edit.php?id=68520 Rashan Anushka]&lt;br /&gt;
&lt;br /&gt;
===Web-based upgrade and plugins interface===&lt;br /&gt;
&lt;br /&gt;
A system for Moodle to be upgraded along with its plugins from within the admin interface.&lt;br /&gt;
&lt;br /&gt;
Currently, adding third party modules/patches can be messy and can especially slow down the upgrade process if CVS is not used. The aim would be to develop a way to package plugins in a standardised way so that a single zip file could be retrieved and installed automatically, similar to the way courses are restored. An added feature would be for the modules and plugins database on moodle.org to have an XML index so that you could browse available plugins from within your own moodle instance and have a one-click install option. Version compatibility info could be included so that only those which will work with your install will be shown. At upgrade time, the new third-party components screen could then show which ones could be upgraded along with the rest of the code and which would need to dropped because there is no compatible replacement.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=92797 Simple Quiz building user interface] forum discussion about work that might be done this summer, although as part of something other than GSOC&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Poltawski</name></author>
	</entry>
</feed>