Commit graph

713 commits

Author SHA1 Message Date
Sitaram Chamarty 89b68bf5ca new adc to allow deleting a branch that you created; see below
The need for this comes about as follows:

  - a project may allow its developers "RWC" (or "RW+C") so that they
    can create feature branches when needed.  Note that these are
    *feature* branches, so they can't use the "personal branches"
    mechanism that gitolite already has.

  - the developers are *not* given RWCD (or RW+CD) to prevent accidental
    deletion of an important branch.  Branch *deletion* is something
    that only a few trusted admins can do.

  - as a result, there are sometimes situations where a developer
    creates a misnamed branch and then has to ask the admins to help get
    rid of it.

What the KDE folks wanted was a way to allow the creator of a branch to
be able to delete it.  In addition, they needed this allowed only for a
fixed duration after the creation of a branch, not forever (for the same
reason they don't get RWCD, to prevent accidents).

These are my reasons why this feature is implemented as an ADC instead
of being "in core":

  - we'd need additional syntax to differentiate this special case
    (which is sort of in between RWC and RWCD, if you think about it).

    I'm reluctant to complicate the syntax further for something that is
    only occasionally needed.

  - we'd need either (a) code to parse the log files, or, (b) code to
    maintain "who created this ref" on every push that creates a ref.

      - parsing the log files is too kludgy and inelegant to be in core,
        not to mention potentially very slow for really large projects

      - code to maintain the a history of "who created this ref" is too
        cumbersome, especially because of the need to expire old entries
        after a time.
2011-05-02 07:15:12 +05:30
Sitaram Chamarty 59f3c4a512 v2.0.1 2011-04-30 06:40:53 +05:30
Sitaram Chamarty 074fc61d3a more docfixes, esp the install doc 2011-04-30 06:39:01 +05:30
Sitaram Chamarty 0d1e05c7e1 "hooklets" -- play nice with any number of site-local 'update' hooks
(yes, I made up the name.  Deal with it!)
2011-04-29 04:47:30 +05:30
Sitaram Chamarty d74e58b5de (minor doc fixes) 2011-04-24 15:16:43 +05:30
Sitaram Chamarty 6a51bae400 update s3backup adc to disable pushes first
(ref http://sitaramc.github.com/gitolite/doc/3-faq-tips-etc.html#_disabling_write_access_to_take_backups)

code from David Bremner via email
2011-04-24 15:14:37 +05:30
Sitaram Chamarty 78444c2e76 gl-system-install: optional 4th arg to help packagers
(buildroot in RPM-speak, DESTDIR in DEB-speak)

based on a patch sent by Francis Galiegue (fgaliegue at gmail)
2011-04-03 21:23:16 +05:30
Sitaram Chamarty 1006eba2fc allow the include statement to use globs
(bonus: we now have a test case for "include" itself, should it ever
decide to take an unplanned vacation!)
2011-04-01 16:11:59 +05:30
Dylan Simon 58064b8e20 Make limit on number of repos displayed by info with GL_BIG_CONFIG configurable
[doc added by Sitaram]
2011-03-30 20:27:12 +05:30
Sitaram Chamarty 0f377a7679 new doc on gitolite without ssh, plus some minor docfixes 2011-03-30 18:42:39 +05:30
Sitaram Chamarty 12ab89abc6 Thomas Berezansky contributed a doc on using putty 2011-03-25 11:15:33 +05:30
Sitaram Chamarty fc2f8ee709 minor docfix to smart http doc 2011-03-25 11:11:41 +05:30
Sitaram Chamarty e837d7a4b9 more mirroring changes...
the first one is commented clearly enough, the second one is a pure bug
(though it wouldn't have affected anything except for the ultra-paranoid
"fsckObjects" config var not being set; no biggie...)
2011-03-21 07:53:50 +05:30
Jos Houtman afc3a06c56 mirror-shell fix: setup GL_RC; post-update needs it 2011-03-21 07:51:24 +05:30
Sitaram Chamarty 6539009cb5 make REPO_BASE absolute early
$ENV{GL_REPO_BASE_ABS} is meant to point to the same directory as
$REPO_BASE, except it is meant to be passed to hooks, ADCs and other
child programs.  And since you can't be sure where the child program
starts in, this became an absolute path.

Gradually, however, I started using it wherever I needed an absolute
path (mostly in code that jumps around various directories to do stuff).
Which is silly, because there's no reason $REPO_BASE cannot also be made
an absolute, even if the rc file has a relative path.

So that's what I did now: made $REPO_BASE absolute very early on, and
then systematically changed all uses of the longer form to the shorter
form when appropriate.  And so the only thing we now use the longer one
for is to pass to child programs.

(Implementation note: The actual change is not very big, but while I was
about it I decided to make the test suite able to test with an absolute
REPO_BASE also, which is why the commit seems so large.)

----

This all started with a complaint from Damien Regad.  He had an
extremely odd setup where his bashrc changed PWD to something other than
$HOME before anything else ran.  This caused those two variables to
beceom inconsistent, and he had a 1-line fix he wanted me to apply.

I generally don't like making special fixes for for non-standard setups,
and anyway all he had to do was set the full path to REPO_BASE in the rc
file to get around this.  Which is what I told him and he very politely
left it at that.

However, this did get me thinking, and I soon realised I was needlessly
conflating "relative versus absolute" with "able to be passed to child
programs".  Fixing that solved his problem also, as a side-effect.

So I guess this is all thanks to Damien!
2011-03-21 07:51:10 +05:30
Ralf Hemmecke 85fe9c1739 (minor) docfix 2011-03-18 06:42:54 +05:30
Sitaram Chamarty 4d913e1c58 Merge branch 'master' into pu (only doc updates) 2011-03-13 18:22:56 +05:30
Sitaram Chamarty 40f40edf20 (minor) fixups to shell-games doc 2011-03-13 18:20:30 +05:30
Sitaram Chamarty e73f1cea93 'hub' adc request-status subcommand can ask for details by request-number 2011-03-13 16:57:54 +05:30
Sitaram Chamarty 719edd007c 's3backup' adc contributed by David Bremner 2011-03-13 09:37:50 +05:30
Sitaram Chamarty 32646e9cf0 (minor) make it clearer when easy install aborts
Technically this does not add any new information, but I'm hoping it
will help the folks just won't read what's on the screen otherwise.

The main impetus this time is git 1.7.4, which is strict about
user.email and user.name and rejects commits when those config variables
are not set.  As a result, the number of times gl-easy-install hits a
fatal error and bombs out without completing its job, has increased
drastically.
2011-03-13 09:37:50 +05:30
Sitaram Chamarty c3787e2d17 hub adc had an unused extra return value from check_access; fixed 2011-03-13 09:37:50 +05:30
Sitaram Chamarty 3677bc5a4d one more slurp
see 9ad7ea4 -- "(minor) some changes to system(), ``, etc."
2011-03-12 04:52:34 +05:30
Sitaram Chamarty b7944ed4d1 (minor) do not purge projects.list if GL_NO_DAEMON_NO_GITWEB set
The code that sets %projlist doesn't even run if GL_NO_DAEMON_NO_GITWEB
is set, so it doesn't make sense to then *use* that (empty) variable and
effectively wipe out the projects.list file.

Thanks to m0 for asking...
2011-03-10 22:12:42 +05:30
Sitaram Chamarty bf7516b2c4 (minor test script fix) 2011-03-10 22:12:42 +05:30
Sitaram Chamarty 23bf41eccd (minor) update mirroring doc about servers and mutual trust 2011-03-10 06:34:32 +05:30
Sitaram Chamarty b0f8924f80 (minor doc clarification)
thanks to kfogel for pointing it out
2011-03-09 21:40:00 +05:30
Sitaram Chamarty 396c23e187 forgot to update changelog when tagging v2.0 and promoting to master 2011-03-09 21:34:03 +05:30
Sitaram Chamarty 9ad7ea4e19 (minor) some changes to system(), ``, etc.
(suggested by cmyers and ryan_c on #gitolite)

Between wrap_print(), which now takes a list, and the new slurp(),
pretty much everything to do with 'cat' or 'echo' has been converted to
pure perl.

----

Personally, I consider these changes to be somewhat gratuitous, because
none of these had a security *or* a performance concern.  But since the
amount of new perl code was not too high (just the slurp() function,
really), I figure it's not a big deal to do it.
2011-03-09 20:11:30 +05:30
Sitaram Chamarty 91a8379f9f change some 'warn's to 'print STDERR' and vice versa
with warns now being logged, it's nice to make sure that anything that
could even vaguely be considered someone playing with the system, *or*
is otherwise noteworthy, be emitted as a 'warn' instead of as a 'print
STDERR'.  Similarly stuff that is clearly a syntactic warning or typo
should come from 'print STDERR', instead of from a 'warn'.
2011-03-08 14:20:35 +05:30
Carl Myers 59a1855e38 Added handler to ensure warn and die are logged
(with some extra changes by Sitaram)
2011-03-08 14:20:35 +05:30
Sitaram Chamarty 80d28e6fb0 Merge branch 'dmitrijsledkovs/pu' into pu 2011-03-05 17:29:20 +05:30
Sitaram Chamarty 396bfaa3b9 gl-auth now checks for and run a hook called 'gl-pre-git'
see sample code for motivation; other uses at your discretion
2011-03-05 12:23:17 +05:30
Sitaram Chamarty aab5ec9e6a 'hub' ADC takes patterns for 'list-request', has new 'accept' command
(plus a few minor fixes)
2011-03-05 12:23:17 +05:30
Sitaram Chamarty ca913af6cd for cool 'cat's who use 'putty' :-)
ryan-c on #gitolite (ryan.castellucci@gmail.com) found that if a user
types in
        ssh git@server `echo -e "\033[2J"`
or eqvt, he can get raw ASCII control characters into gitolite's log
file.  Then if a gitolite admin 'cat's the log file (instead of using a
pager, or uses a pager in raw mode like 'less -r'), those control
characters hit his screen and do stuff.

While clearing the screen etc is probably harmless and I would not have
bothered, we know that the old vt100 would allow the keyboard to be
remapped by the server sending control codes, and we're not really sure
which of the currently in use terminals emulate this.

And finally, I found somewhere that "PuTTY allows the server to send
control codes that let it take over the mouse".  Scary...

(...of course, I hate putty/plink so I was sorely tempted to leave this
as is to punish people who use it <grin> but not really; I'd joke about
it but won't actually *do* it!)
2011-03-05 05:56:58 +05:30
Sitaram Chamarty 6d3c2fbcef 'hub' ADC doc and rudimentary test script 2011-03-03 15:39:54 +05:30
Sitaram Chamarty 49e64a4f11 'hub' ADC 2011-03-03 15:39:54 +05:30
Sitaram Chamarty 284431e661 (minor) added info on config vars to admin-defined-commands.mkd 2011-03-02 23:24:45 +05:30
Dmitrijs Ledkovs a78d969f7c Fix a typo in docs 2011-03-01 12:29:57 +00:00
Sitaram Chamarty 635ccfafd0 (minor doc enhancement) how to rename a repo 2011-02-26 00:32:53 +05:30
Sitaram Chamarty e7d55899f3 fork adc acquired some good ideas from the KDE folks 2011-02-25 21:15:08 +05:30
Sitaram Chamarty 46528f0cc7 squelch useless "undefined" warnings
Normal users will never need this change but the big boys like to play
on the server side directly... and sometimes the SSH_CONNECTION var is
not set
2011-02-25 20:39:59 +05:30
Sitaram Chamarty cec94a3664 (minor) who-pushed adc falls afoul of egrep incompat between Linux distros!
It seems even within Linux, not all "egrep"s are equal.  So we fall back
to the one true standard :-)

[caught by Jeff from the KDE team]
2011-02-25 06:21:17 +05:30
Sitaram Chamarty bdef55eee9 (minor) bashism fixes, usability fix, for "able" adc 2011-02-25 06:21:13 +05:30
Sitaram Chamarty 9a49487d0a minor bug in data format fixup code
Earlier, it wasn't as critical for gl-setup to be run with the full
path; the BINDIR deduction used to happen in almost every program.  Now
it's a lot more important.

Apparently I never noticed that "/bin/bash -l gl-setup" does not set $0
to the correct, fq path.  Adding a "-c" does, however...

[thanks to Jeff from the KDE team for finding this]
2011-02-25 06:20:41 +05:30
Sitaram Chamarty bc5e995078 reach out and touch someone
This shaves 3 seconds off of KDE's config compile time :-)

Yes, I know wrap_print has that extra print statement, but otherwise it
was lying around not earning its keep so I gave it a little side job :-)
2011-02-22 13:28:02 +05:30
Sitaram Chamarty 02128ff48f (minor doc fixes) 2011-02-21 21:25:43 +05:30
Sitaram Chamarty dfdab0f3c8 allow gitolite_rc.mkd values to be overridden by ~/.gitolite.rc
you might wonder why these are different from all the other variables in
the rc file... it's just that I never thought people would want to
change these!
2011-02-15 15:10:29 +05:30
Sitaram Chamarty b97115f85b Merge branch 'master' into pu 2011-02-15 15:10:14 +05:30
Sitaram Chamarty 4ce00aef84 security fix for optional ADC (admin-defined command) feature
Thanks to Dylan Simon for catching it...
2011-02-15 14:58:42 +05:30