Enable aliases for SSH commands

Site administrators can alias SSH commands from a plugin into the
gerrit namespace using the ssh-alias section in gerrit.config:

  [ssh-alias]
    ls = gerrit ls-projects
    replicate = replication start

The aliases are configured statically at server startup, but are
resolved dynamically at invocation time to the currently loaded
version of the plugin. If the plugin is not loaded, or does not
define the command, "not found" is returned to the user.

Change-Id: Ie98edbef6c8f2fcb3960e7f06329f5dee670ac1e
This commit is contained in:
Shawn O. Pearce
2012-05-11 14:57:56 -07:00
parent ba99c03981
commit 521380a28d
10 changed files with 243 additions and 25 deletions

View File

@@ -218,7 +218,7 @@ public class WebAppInitializer extends GuiceServletContextListener {
private Injector createSshInjector() {
final List<Module> modules = new ArrayList<Module>();
modules.add(new SshModule());
modules.add(sysInjector.getInstance(SshModule.class));
modules.add(new MasterCommandModule());
return sysInjector.createChildInjector(modules);
}