Add options to refs/for/ magic branch syntax

Git doesn't want to modify the network protocol to support passing
data from the git push client to the server. Work around this by
embedding option data into a new style of reference specification:

  refs/for/master%r=alice,cc=bob,cc=charlie,topic=options

is now parsed by the server as:

  - set topic to "options"
  - CC charlie and bob
  - add reviewer alice
  - for branch refs/heads/master

If % is used the "extra information" after the branch name is
parsed as options with args4j. Each option is delimited by ",".

Selecting publish vs. draft should be done with options draft or
publish, appearing anywhere in the refspec after the % marker:

  refs/for/master%draft
  refs/for/master%draft,r=alice
  refs/for/master%r=alice,draft
  refs/for/master%r=alice,publish

Change-Id: I895bd1218c2099b5b45cac943039bbd12565370c
This commit is contained in:
Shawn Pearce
2013-02-24 18:01:27 -08:00
parent 7882a0da1a
commit 69928a6d06
7 changed files with 157 additions and 100 deletions

View File

@@ -25,6 +25,7 @@ import com.google.gerrit.server.RemotePeer;
import com.google.gerrit.server.config.FactoryModule;
import com.google.gerrit.server.config.GerritRequestModule;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.git.AsyncReceiveCommits;
import com.google.gerrit.server.git.QueueProvider;
import com.google.gerrit.server.git.WorkQueue;
import com.google.gerrit.server.plugins.ModuleGenerator;
@@ -65,6 +66,7 @@ public class SshModule extends FactoryModule {
bind(SshScope.class).in(SINGLETON);
configureRequestScope();
install(new AsyncReceiveCommits.Module());
install(new CmdLineParserModule());
configureAliases();