Commit graph

286 commits

Author SHA1 Message Date
Sitaram Chamarty 89cc3a303d Test.pm learned confreset() and confadd() 2012-03-24 10:30:42 +05:30
Sitaram Chamarty 356ff2b757 store got a few more validations
(a full scan of all input data is pending; this is just for diagnostics)
2012-03-24 10:30:42 +05:30
Sitaram Chamarty 7f8020adc5 'info' command, plus lots more changes:
- usage() gets a little smarter; it now knows what function it was called
    from and tries to find a '=for function_name' chunk of data in the script

  - the various list-* functions now work off a dispatcher in Load.pm
  - (...and they all use the new usage() magic to print their helps!)

  - src/gitolite got a lot leaner due to this dispatcher

  - src/gitolite-shell became a lot more easier to read/flow

  - rc acquired '{COMMANDS}', which gitolite-shell now refers to
  - comments in the default rc file changed a bit
  - rc got a new REMOTE_COMMAND_PATT (in place of ADC_CMD_ARGS_PATT)

the rest is perltidy and stuff like that
2012-03-24 10:30:42 +05:30
Sitaram Chamarty 0aeb0cd5e2 ssh-authkeys done! 2012-03-24 10:30:42 +05:30
Sitaram Chamarty cbd4d43687 (minor) usage() sub can handle multiple usage sections in the same script 2012-03-24 10:30:42 +05:30
Sitaram Chamarty 84422ccf30 (rc) prefix GL_BINDIR to PATH
Needed when the user didn't actually "install" but is just running it by
using the full path to "gitolite".  Without this, every time my code
runs "gitolite <some sub-command>" I have to prefix "gitolite" with
$ENV{GL_BINDIR}, which is kinda painful...
2012-03-24 10:30:42 +05:30
Sitaram Chamarty 428485086f query-rc learned '-n' to avoid the need to chomp() the result 2012-03-24 10:30:42 +05:30
Sitaram Chamarty ef476f0d32 common: slurp() learns to look at wantarray 2012-03-24 10:30:42 +05:30
Sitaram Chamarty c19f75e119 (subconf) add the warning message
(not as prominent as in g2 though...)
2012-03-24 10:30:42 +05:30
Sitaram Chamarty d64663d12e COUNT VREF and tests 2012-03-24 10:30:42 +05:30
Sitaram Chamarty 16d17def2a VREF code 2012-03-24 10:30:42 +05:30
Sitaram Chamarty ef021ee293 (test) forgot to set user.email/name to the standard value
caused old test scripts to fail (wherever I was checking the actual SHA
anyway)
2012-03-24 10:30:41 +05:30
Sitaram Chamarty fb69f6e328 (test setup) make Test.pm do a bit more 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 17476318b9 (trace) formatting changed when more than one arg passed 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 56cda99edd fixup CWD in access(); see below
Calling access() changes the CWD to $GL_REPO_BASE!

This causes a problem in the update script -- you're suddenly in the
wrong directory after calling access()!

This is actually happening inside load_1(), so fix that.
2012-03-24 10:30:41 +05:30
Sitaram Chamarty 877f6eb31b catch older gitolite.rc and die gracefully 2012-03-24 10:30:41 +05:30
Sitaram Chamarty a9d5adcd10 example sugar script 'continuation-lines' added 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 0fdd80f487 (tests) added a module test for explode
plus a helper function to Test.pm (helps while developing tests)
2012-03-24 10:30:41 +05:30
Sitaram Chamarty a0305ec029 sugar 'option'; see below
option foo = bar
      ->  config gitolite-options.foo = bar
2012-03-24 10:30:41 +05:30
Sitaram Chamarty 379b0c9549 install/test made easy (WARNING: read below)
(1) testing is very easy, just run this from a clone

        t/g3-clean-install-setup-test

    BUT BE WARNED THIS IS DESTRUCTIVE; details in t/WARNING

(2) install is equally simple; see 'INSTALL' in the main directory
2012-03-24 10:30:41 +05:30
Sitaram Chamarty acb2f8fe8e sugar high!
make it easy to handle syntactic sugar.  In summary, compile now calls
parse(sugar('gitolite.conf')).

Details:

  - cleanup_conf_line went from subar.pm to common.pm
  - explode() and minions went from conf.pm to the new explode.pm
  - the callback went away; everyone just passes whole arrays around now
  - the new sugar() takes a filename and returns a listref
  - all sugar scripts take and return a listref

  - the first "built-in" sugar is written (setting gitweb.owner and
    gitweb.description)

the new RC file format (of being a hash called %rc) is getting a nice
workout :-)
2012-03-24 10:30:41 +05:30
Sitaram Chamarty 4ab8db4925 gitolite/commands/setup -> gitolite/setup 2012-03-24 10:30:41 +05:30
Sitaram Chamarty dfccf1b0de t01-basic completed, some change to test.pm as well 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 56be906e5d deny message change; t01 also changed accordingly 2012-03-24 10:30:41 +05:30
Sitaram Chamarty b89ac4dd1e queryrc.pm rolled into rc.pm, removed 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 8ffc5307d6 (lotsa files affected) rc file format changed; see below
The rc file used to be a bunch of variables, each one requiring to be
declared before being used.  While this was nice and all, it was a
little cumbersome to add a new flag or option.

If you disregard the "catch typos" aspect of having to predeclare
variables, it's a lot more useful to have all of rc be in a hash and use
any hash keys you want.

There could be other uses; for instance it could hold arbitrary data
that you would currently put in %ENV, without having to pollute %ENV if
you don't need child tasks to inherit it.

----

NOTE: I also ran perltidy, which I don't always remember to :)
2012-03-24 10:30:41 +05:30
Sitaram Chamarty 1a1be8b222 'gitolite list-phy-repos' added 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 95c6952e11 list_phy_repos() moved from store.pm to common.pm
but you need to chdir() to the right place before calling it
2012-03-24 10:30:41 +05:30
Sitaram Chamarty 00934c8304 'gitolite list-members' added 2012-03-24 10:30:41 +05:30
Sitaram Chamarty c9826eee07 'gitolite list-memberships' added 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 4e81d3cfed 'gitolite list-repos' added, plus some usage message changes 2012-03-24 10:30:41 +05:30
Sitaram Chamarty d88cdbefd6 'gitolite list-users' added (but see warnings)
this is pretty slow if you have thousands of repos, since it has to read
and parse a 'gl-conf' file for every repo.  (For example, on a Lenovo
X201 thinkpad with 11170 repos and a cold cache, it took 288 seconds).

(With a hot cache -- like if you run the command again -- it took 2.1
seconds!  So if you have a fast disk this may not be an issue for you
even if you have 10,000+ repos).
2012-03-24 10:30:41 +05:30
Sitaram Chamarty 1be66dc10e 'gitolite list-groups' added 2012-03-24 10:30:41 +05:30
Sitaram Chamarty b0ceac2594 chdirs moved from load() to load_common() and load_1() 2012-03-24 10:30:41 +05:30
Sitaram Chamarty 60e190215e very basic, usable, first cut done
- sausage making hidden
  - lots of important features missing
2012-03-24 10:30:37 +05:30
Sitaram Chamarty 5fd06036ed empty 2012-02-28 22:15:45 +05:30