1 # why a completely new version?
3 This file is no longer maintained; it is here only for historical purposes.
7 Gitolite started life as 400 lines of perl written on a weekend because I was
8 quickly losing control of my projects at work, exacerbated by git newbies
9 doing all the wrong things. I really needed it!
11 That little 400 line thing is now a huge bunch of programs that do all sorts
12 of things (I mean, rsync access control in a git related program? WTF!),
13 because it kinda just *grew* while I wasn't looking.
15 So, briefly, here are the advantages of v3:
17 * compile versus everything else
19 v2's "compile" script was doing way, way too much. For example, dealing
20 with gitweb and git-daemon was a good chunk of code in v2. In contrast,
21 here's how v3 generates gitweb's projects.list file:
24 gitolite list-phy-repos | gitolite access % gitweb R any | grep -v DENIED
25 gitolite list-phy-repos | gitolite git-config -r % gitweb\\.
27 cut -f1 | sort -u | sed -e 's/$/.git/' > $plf
29 * core versus non-core
31 That's just the tip of the iceberg. The commands above run from a script
32 that is itself outside gitolite, and can be enabled and disabled from the
33 rc file. There are six different "events" within gitolite that can
34 trigger non-core programs (or call functions in non-core perl modules),
35 with specific arguments passed to them, much like git's own hooks. The
36 example you saw is called from the "POST_COMPILE" trigger.
38 And as you can see, these programs be in any language.
40 * get/set perms/desc, and ADCs
42 I've always wanted to kick setperms out of core and make it an ADC.
43 Sadly, it couldn't be done because when you update your repo's permissions
44 using setperms, that can affect gitweb/daemon access, which -- you guessed
45 right -- feeds back into the main code in complex ways. It *had* to be an
48 But now, the new 'perms' program is quite external to gitolite. And how
49 does it fix up gitweb/daemon permissions after it is done updating the
52 system("gitolite", "trigger", "POST_CREATE");
54 * syntax versus semantics
56 I got tired of people asking things like "why can't I have
57 backslash-escaped continuation lines?" I designed it differently because
58 I don't like them but perhaps it's reasonable for some people.
60 Someone else wanted to use subdirectories of 'keydir' as group names. Why
63 v3 comes with a stackable set of "syntactic sugar" helpers. And you can
64 write your own, though they do have to be in perl (because they're not
67 Once the code is written and placed in the right place, all you have to do
68 to enable it is to uncomment some lines in the ENABLE list in the rc file:
70 # 'continuation-lines',
71 # 'keysubdirs-as-groups',
76 Having a decent shell API helps enormously. You saw an example above but
77 how about if your boss asks you "I need a list of everyone who *currently*
78 has read access to the 'foo' repo"?
80 Sure you could look in conf/gitolite.conf, all its include files (if you
81 have any), and if the repo is user-created, then in its gl-perms.
83 Or you could do something like this:
85 gitolite list-users | gitolite access foo % R any | cut -f1
89 v2 was, to some extent, over-engineered. One of the best examples is the
90 documentation on hook-propagation in v2, which was far too complicated
93 Anyway you get the idea.
95 The point is not that you can do all these cool tricks. The point is they are
96 possible because of the redesign. There is no way on God's green earth I
97 could have done this with the old code.