Difference between revisions of "Git"
B michaelsen (Talk | contribs) |
|||
(30 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
Git is a popular version control system designed to handle very large projects with speed and efficiency. See http://git.or.cz/ for more info. | Git is a popular version control system designed to handle very large projects with speed and efficiency. See http://git.or.cz/ for more info. | ||
− | The Windows users might be interested in the [http://www.gelato.unsw.edu.au/archives/git/0701/38380.html MinGW git port]. | + | The Windows users might be interested in the [http://www.gelato.unsw.edu.au/archives/git/0701/38380.html MinGW git port] ([http://lilypond.org/git/binaries/mingw/ binaries]). |
== Git and OpenOffice.org == | == Git and OpenOffice.org == | ||
Line 9: | Line 9: | ||
* The 3rd party stuff (binary mozilla, zlib, berkeleydb, ...) - <tt>3rdparty.git</tt> | * The 3rd party stuff (binary mozilla, zlib, berkeleydb, ...) - <tt>3rdparty.git</tt> | ||
− | The size of the sources is about 1. | + | The size of the sources is about 1.3G, the size of the 3rd party stuff is 591M. Please follow the instructions on http://go-oo.org/git to get the tree. |
+ | |||
+ | For testing purposes, even a git tree '''without history''' is available as <tt>git://go-oo.org/git/without-history/src680-m211.git</tt>. It is a full import of src680-m211 (with the 3rdparty libraries, localizations, etc.) The plan is to start the OOo git tree as a tree without history with the possibility to 'graft' the history into this ([http://tools.openoffice.org/servlets/ReadMsg?list=dev&msgNo=6198 message], [http://repo.or.cz/w/elinks.git?a=blob;f=contrib/grafthistory.sh sample script]). | ||
== Transformations == | == Transformations == | ||
Line 19: | Line 21: | ||
* 'CWS_SRC680_XYZ_ANCHOR' tags are renamed to simple 'XYZ' | * 'CWS_SRC680_XYZ_ANCHOR' tags are renamed to simple 'XYZ' | ||
* 'INTEGRATION: CWS xyz' commits are grouped into one commit (they are generated by CWS tooling per-file), and treated as a ''merge'' in the git tree | * 'INTEGRATION: CWS xyz' commits are grouped into one commit (they are generated by CWS tooling per-file), and treated as a ''merge'' in the git tree | ||
+ | * Tabs are converted to 4 spaces at the beginning of the lines in .c/.cxx/.h/.hxx/.mk/.src | ||
+ | * 'RESYNC:.*FILE MERGED', and 'RESYNC:.*FILE REMOVED' are grouped inside branches (with single 'RESYNC' log entry) | ||
+ | ** May result in multiple 'RESYNC' commits inside the branch when a commit happened to another one in the middle of the resync | ||
+ | |||
+ | After creating the tree, it is worth repacking, like | ||
+ | |||
+ | <pre> | ||
+ | git repack -a -f --depth=50 --window=250 | ||
+ | </pre> | ||
+ | |||
+ | If it's going out of memory, one can limit it: | ||
+ | |||
+ | <pre> | ||
+ | git config pack.deltaCacheLimit 1 | ||
+ | git config pack.deltaCacheSize 1 | ||
+ | git config pack.windowMemory 4g | ||
+ | </pre> | ||
== Requirements/TODO == | == Requirements/TODO == | ||
− | |||
* Convert CollabNet account names into real names | * Convert CollabNet account names into real names | ||
** maybe use the data from [[DomainDeveloper]] (complete that where necessary) if there's no easy way to extract the names from CollabNet | ** maybe use the data from [[DomainDeveloper]] (complete that where necessary) if there's no easy way to extract the names from CollabNet | ||
− | |||
* Delete merged branches (from 'heads', not from history!) | * Delete merged branches (from 'heads', not from history!) | ||
− | * | + | * Provide the too old history as 'graft' - see eg. http://repo.or.cz/w/elinks.git?a=blob;f=contrib/grafthistory.sh |
+ | * Translations to a separate git tree as well? | ||
+ | * URE to a separate git tree? | ||
+ | * ODF Toolkit to a separate git tree? | ||
+ | * .pdf version of developer's guide consume quite some space as well - any chance to do something with it? | ||
== Comparison == | == Comparison == | ||
+ | |||
+ | === General === | ||
+ | |||
+ | Links to Git comparison with other SCMs: http://git.or.cz/gitwiki/GitLinks#comparison | ||
+ | |||
+ | Comparison of git with Subversion: http://git.or.cz/gitwiki/GitSvnComparsion | ||
+ | |||
+ | === Machines used for the testing === | ||
+ | |||
+ | CVS tests: | ||
+ | * ??? | ||
+ | |||
+ | Git tests [let's call this one 'git machine' ;-)]: | ||
+ | * CPU: AMD Athlon(tm) 64 Processor 3200+ | ||
+ | * RAM: 1G | ||
+ | * Disk (info from bonnie): | ||
+ | ---Sequential Output (nosync)--- ---Sequential Input-- --Rnd Seek- | ||
+ | -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --04k (03)- | ||
+ | Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU | ||
+ | one 1*2000 37819 77.6 44296 16.8 16982 5.1 35203 63.9 45915 6.6 152.4 0.4 | ||
+ | * OS: SUSE 10.1 | ||
+ | * Filesystem: ext3 | ||
+ | * Net connection: ~20Mbit | ||
+ | |||
+ | SVN tests: | ||
+ | * ??? | ||
+ | |||
+ | === Notes === | ||
+ | |||
+ | The git repository could [should! ;-)] be tuned for better results: | ||
+ | * '''Delete integrated branches''' - the history will be still preserved, just the number of open heads will reduce (by about 3000) | ||
+ | * '''Graft history''' - the old development can be 'hidden' and available just to those who really need it using a simple script, like http://repo.or.cz/w/elinks.git?a=blob;f=contrib/grafthistory.sh . This way we can save about 1G of download! | ||
+ | |||
+ | === The Results === | ||
{| border="1" cellspacing="0" cellpadding="5" | {| border="1" cellspacing="0" cellpadding="5" | ||
Line 37: | Line 92: | ||
!SVN | !SVN | ||
|- | |- | ||
− | | | + | |Size of data on the server [OOo sources] |
|8.5G | |8.5G | ||
− | |1. | + | |1.3G |
− | | | + | | |
|- | |- | ||
− | |3rd party | + | |Size of data on the server [3rd party] |
|1.1G | |1.1G | ||
− | | | + | |591M |
− | | -"- | + | | |
+ | |- | ||
+ | |Size of checkout [OOo sources] | ||
+ | |1.4G | ||
+ | |2.8G [files you can hack on (contains localize.sdf's) + the history] | ||
+ | |3.3G [files you can hack on + localize.sdf's from data-trunk + .svn directories] | ||
+ | |- | ||
+ | |Size of checkout [3rd party] | ||
+ | |98M | ||
+ | |688M [files you can hack on + the history] | ||
+ | |199M [files you can hack on + .svn directories] | ||
+ | |- | ||
+ | |Initial checkout time [OOo sources] | ||
+ | |117 minutes (Linux, 2MBit DSL), 26 minutes (Linux, 2MBit DSL, with compression (-z 6) | ||
+ | |130 minutes, (51 min for a pull) (Linux, 2MBit DSL) [from go-oo.org]<br/> | ||
+ | 100min (Linux, 2MBit DSL, Wireless, no proxy) [from go-oo.org] (1586669 objects (counting, deltifying, indexing) 1144663 deltas to resolve)<br/> | ||
+ | 44min (faster machine than the [git machine], but with the same connection) [from go-oo.org] | ||
+ | | 60 minutes (Windows, 34Mbit Line)<br/> | ||
+ | 58 min [git machine] | ||
+ | |- | ||
+ | |Initial checkout time [3rd party] | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- | ||
+ | |Branch creation | ||
+ | | | ||
+ | |Immediately | ||
+ | |Immediately with local svn server, 25 sec with collab.net server | ||
+ | |- | ||
+ | |Branch switch | ||
+ | | | ||
+ | |<15sec [to newly created], 3min to an old one | ||
+ | |12min 40sec [git machine] ?? | ||
+ | |- | ||
+ | |Diff | ||
+ | | | ||
+ | |Immediately | ||
+ | |4min 13sec [git machine] | ||
+ | |- | ||
+ | |Commit | ||
+ | | | ||
+ | |13-25sec | ||
+ | | | ||
+ | |- | ||
+ | |Merge | ||
+ | | | ||
+ | |10sec [new branch with few changes], <3min [long living branch, harder scenario] | ||
+ | | | ||
+ | |- | ||
+ | |Resync | ||
+ | | | ||
+ | |Same as 'Merge' - it's a merge from 'master' to the branch. | ||
+ | | | ||
+ | |- | ||
+ | |Integration | ||
+ | | | ||
+ | |Same as 'Merge' - it's a merge from a branch to the 'master'. | ||
+ | | | ||
+ | |- | ||
+ | |Push | ||
+ | |Not necessary | ||
+ | |push back one branch in local network: 9 sec, push back repository 40 min | ||
+ | |Not necessary | ||
+ | |} | ||
+ | |||
+ | '3rd party' in this context means the following modules: <tt>agg</tt>, <tt>beanshell</tt>, <tt>berkeleydb</tt>, <tt>bitstream_vera_fonts</tt>, <tt>boost</tt>, <tt>curl</tt>, <tt>dictionaries</tt>, <tt>epm</tt>, <tt>expat</tt>, <tt>freetype</tt>, <tt>hsqldb</tt>, <tt>icu</tt>, <tt>jpeg</tt>, <tt>libwpd</tt>, <tt>libxml2</tt>, <tt>moz</tt>, <tt>msfontextract</tt>, <tt>nas</tt>, <tt>neon</tt>, <tt>np_sdk</tt>, <tt>portaudio</tt>, <tt>python</tt>, <tt>sablot</tt>, <tt>sane</tt>, <tt>sndfile</tt>, <tt>stlport</tt>, <tt>vigra</tt>, <tt>xalan</tt>, <tt>xt</tt>, <tt>zlib</tt>. | ||
+ | |||
+ | Commands used for the tests: | ||
+ | {| border="1" cellspacing="0" cellpadding="5" | ||
+ | !What | ||
+ | !CVS | ||
+ | !git | ||
+ | !SVN | ||
+ | |- | ||
+ | |checkout [OOo sources] | ||
+ | |<tt>cvs -d:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs co OpenOffice2</tt> | ||
+ | |<tt>git clone git://go-oo.org/git/openoffice.org/ooo.git openoffice.org</tt> (How does this work with a proxy) | ||
+ | |<tt> svn checkout http://svn.stage.openoffice.org/svn/svn/trunk svn</tt><br/> | ||
+ | (This tree does not contain localize.sdf's, they are in <tt>trunk-data</tt>.) | ||
+ | |- | ||
+ | |Branch creation | ||
+ | | | ||
+ | |[all the following commands were issued in the openoffice.org subdir]<br/> | ||
+ | <tt>git branch test</tt> | ||
+ | |[all the following commands were issued in the svn subdir] | ||
+ | |- | ||
+ | |Branch switch | ||
+ | | | ||
+ | |<tt>git checkout test</tt> | ||
+ | |<tt>svn switch http://svn.stage.openoffice.org/svn/svn/vendors/sun-cvs/tags/SRC680_m172</tt> | ||
+ | |- | ||
+ | |Diff | ||
+ | | | ||
+ | |<tt>vim vcl/unx/kde/salnativewidgets-kde.cxx</tt> [to do some changes] <tt>; git diff</tt> | ||
+ | |<tt>vim vcl/unx/kde/salnativewidgets-kde.cxx</tt> [to do some changes] <tt>; svn diff</tt> | ||
+ | |- | ||
+ | |Commit | ||
+ | | | ||
+ | |[with the changes from 'Diff']<br/> | ||
+ | <tt>git commit -a</tt> | ||
+ | | | ||
+ | |- | ||
+ | |Merge [the simple scenario] | ||
+ | | | ||
+ | |<tt>git branch test2 ; git checkout test2 ; vim vcl/unx/kde/salnativewidgets-kde.cxx</tt> [another changes] <tt>; git commit -a ; git checkout test</tt> [preparation to have something to merge]<br/> | ||
+ | <tt>git pull . test2</tt> [the merge itself] | ||
+ | | | ||
+ | |- | ||
+ | |Merge [the harder scenario] | ||
+ | | | ||
+ | |<tt>git pull git://go-oo.org/git/openoffice.org/ooo.git unxsplash</tt><br/> | ||
+ | [an old CWS of mine - called cws_src680_unxsplash in the CVS] | ||
+ | | | ||
+ | |- | ||
+ | |Resync | ||
+ | | | ||
+ | |[it's usually not necessary to do resynces with git; but when needed to get a feature a branch would depend on, it's just a merge from remote 'master'] | ||
+ | | | ||
+ | |- | ||
+ | |Integration | ||
+ | | | ||
+ | |<tt>git checkout master ; git pull . test</tt><br/> | ||
+ | [or alternatively: <tt>git checkout master ; git merge 'merging test into master' master test</tt>] | ||
+ | | | ||
|} | |} | ||
+ | [[Category:SCM]] |
Latest revision as of 00:40, 16 December 2009
Git is a popular version control system designed to handle very large projects with speed and efficiency. See http://git.or.cz/ for more info.
The Windows users might be interested in the MinGW git port (binaries).
Contents
Git and OpenOffice.org
A functional git tree with the entire OOo history for testing purposes is here: http://go-oo.org/git. It is an imported CVS tree that was split into two parts:
- The sources themselves - ooo.git
- The 3rd party stuff (binary mozilla, zlib, berkeleydb, ...) - 3rdparty.git
The size of the sources is about 1.3G, the size of the 3rd party stuff is 591M. Please follow the instructions on http://go-oo.org/git to get the tree.
For testing purposes, even a git tree without history is available as git://go-oo.org/git/without-history/src680-m211.git. It is a full import of src680-m211 (with the 3rdparty libraries, localizations, etc.) The plan is to start the OOo git tree as a tree without history with the possibility to 'graft' the history into this (message, sample script).
Transformations
These transformations are done while converting from CVS:
- The OOo repository is split into the sources and 3rd party sources as described above
- 'cws_src680_xyz' branches are renamed to simple 'xyz'
- 'CWS_SRC680_XYZ_ANCHOR' tags are renamed to simple 'XYZ'
- 'INTEGRATION: CWS xyz' commits are grouped into one commit (they are generated by CWS tooling per-file), and treated as a merge in the git tree
- Tabs are converted to 4 spaces at the beginning of the lines in .c/.cxx/.h/.hxx/.mk/.src
- 'RESYNC:.*FILE MERGED', and 'RESYNC:.*FILE REMOVED' are grouped inside branches (with single 'RESYNC' log entry)
- May result in multiple 'RESYNC' commits inside the branch when a commit happened to another one in the middle of the resync
After creating the tree, it is worth repacking, like
git repack -a -f --depth=50 --window=250
If it's going out of memory, one can limit it:
git config pack.deltaCacheLimit 1 git config pack.deltaCacheSize 1 git config pack.windowMemory 4g
Requirements/TODO
- Convert CollabNet account names into real names
- maybe use the data from DomainDeveloper (complete that where necessary) if there's no easy way to extract the names from CollabNet
- Delete merged branches (from 'heads', not from history!)
- Provide the too old history as 'graft' - see eg. http://repo.or.cz/w/elinks.git?a=blob;f=contrib/grafthistory.sh
- Translations to a separate git tree as well?
- URE to a separate git tree?
- ODF Toolkit to a separate git tree?
- .pdf version of developer's guide consume quite some space as well - any chance to do something with it?
Comparison
General
Links to Git comparison with other SCMs: http://git.or.cz/gitwiki/GitLinks#comparison
Comparison of git with Subversion: http://git.or.cz/gitwiki/GitSvnComparsion
Machines used for the testing
CVS tests:
- ???
Git tests [let's call this one 'git machine' ;-)]:
- CPU: AMD Athlon(tm) 64 Processor 3200+
- RAM: 1G
- Disk (info from bonnie):
---Sequential Output (nosync)--- ---Sequential Input-- --Rnd Seek- -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --04k (03)- Machine MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU /sec %CPU one 1*2000 37819 77.6 44296 16.8 16982 5.1 35203 63.9 45915 6.6 152.4 0.4
- OS: SUSE 10.1
- Filesystem: ext3
- Net connection: ~20Mbit
SVN tests:
- ???
Notes
The git repository could [should! ;-)] be tuned for better results:
- Delete integrated branches - the history will be still preserved, just the number of open heads will reduce (by about 3000)
- Graft history - the old development can be 'hidden' and available just to those who really need it using a simple script, like http://repo.or.cz/w/elinks.git?a=blob;f=contrib/grafthistory.sh . This way we can save about 1G of download!
The Results
What | CVS | git | SVN |
---|---|---|---|
Size of data on the server [OOo sources] | 8.5G | 1.3G | |
Size of data on the server [3rd party] | 1.1G | 591M | |
Size of checkout [OOo sources] | 1.4G | 2.8G [files you can hack on (contains localize.sdf's) + the history] | 3.3G [files you can hack on + localize.sdf's from data-trunk + .svn directories] |
Size of checkout [3rd party] | 98M | 688M [files you can hack on + the history] | 199M [files you can hack on + .svn directories] |
Initial checkout time [OOo sources] | 117 minutes (Linux, 2MBit DSL), 26 minutes (Linux, 2MBit DSL, with compression (-z 6) | 130 minutes, (51 min for a pull) (Linux, 2MBit DSL) [from go-oo.org] 100min (Linux, 2MBit DSL, Wireless, no proxy) [from go-oo.org] (1586669 objects (counting, deltifying, indexing) 1144663 deltas to resolve) |
60 minutes (Windows, 34Mbit Line) 58 min [git machine] |
Initial checkout time [3rd party] | |||
Branch creation | Immediately | Immediately with local svn server, 25 sec with collab.net server | |
Branch switch | <15sec [to newly created], 3min to an old one | 12min 40sec [git machine] ?? | |
Diff | Immediately | 4min 13sec [git machine] | |
Commit | 13-25sec | ||
Merge | 10sec [new branch with few changes], <3min [long living branch, harder scenario] | ||
Resync | Same as 'Merge' - it's a merge from 'master' to the branch. | ||
Integration | Same as 'Merge' - it's a merge from a branch to the 'master'. | ||
Push | Not necessary | push back one branch in local network: 9 sec, push back repository 40 min | Not necessary |
'3rd party' in this context means the following modules: agg, beanshell, berkeleydb, bitstream_vera_fonts, boost, curl, dictionaries, epm, expat, freetype, hsqldb, icu, jpeg, libwpd, libxml2, moz, msfontextract, nas, neon, np_sdk, portaudio, python, sablot, sane, sndfile, stlport, vigra, xalan, xt, zlib.
Commands used for the tests:
What | CVS | git | SVN |
---|---|---|---|
checkout [OOo sources] | cvs -d:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs co OpenOffice2 | git clone git://go-oo.org/git/openoffice.org/ooo.git openoffice.org (How does this work with a proxy) | svn checkout http://svn.stage.openoffice.org/svn/svn/trunk svn (This tree does not contain localize.sdf's, they are in trunk-data.) |
Branch creation | [all the following commands were issued in the openoffice.org subdir] git branch test |
[all the following commands were issued in the svn subdir] | |
Branch switch | git checkout test | svn switch http://svn.stage.openoffice.org/svn/svn/vendors/sun-cvs/tags/SRC680_m172 | |
Diff | vim vcl/unx/kde/salnativewidgets-kde.cxx [to do some changes] ; git diff | vim vcl/unx/kde/salnativewidgets-kde.cxx [to do some changes] ; svn diff | |
Commit | [with the changes from 'Diff'] git commit -a |
||
Merge [the simple scenario] | git branch test2 ; git checkout test2 ; vim vcl/unx/kde/salnativewidgets-kde.cxx [another changes] ; git commit -a ; git checkout test [preparation to have something to merge] git pull . test2 [the merge itself] |
||
Merge [the harder scenario] | git pull git://go-oo.org/git/openoffice.org/ooo.git unxsplash [an old CWS of mine - called cws_src680_unxsplash in the CVS] |
||
Resync | [it's usually not necessary to do resynces with git; but when needed to get a feature a branch would depend on, it's just a merge from remote 'master'] | ||
Integration | git checkout master ; git pull . test [or alternatively: git checkout master ; git merge 'merging test into master' master test] |