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
diff --git a/Documentation/cmd-receive-pack.txt b/Documentation/cmd-receive-pack.txt index 68f686d..92bb65e 100644 --- a/Documentation/cmd-receive-pack.txt +++ b/Documentation/cmd-receive-pack.txt
@@ -32,28 +32,12 @@ --reviewer <address>:: --re <address>:: - Automatically add <address> as a reviewer to any change - created or updated by the pushed commit objects. These - changes will appear in the reviewer's dashboard, and will - also be emailed to the reviewer. -+ -May be specified more than once to request multiple reviewers. -+ -This is a Gerrit Code Review specific extension. + Automatically add <address> as a reviewer to any change. + Deprecated, use `refs/for/branch%r=address` instead. --cc <address>:: - Carbon-copy <address> on the created or updated changes, - but don't request them to perform a review. Like with - --reviewer the changes will appear in the CC'd user's - dashboard, and will be emailed to them. -+ -May be specified more than once to specify multiple CCs. -+ -This is a Gerrit Code Review specific extension. - -Above <address> may be the complete email address, or, if Gerrit is -configured with HTTP authentication (e.g. within a single domain), -just the local part (typically username). + Carbon-copy <address> on the created or updated changes. + Deprecated, use `refs/for/branch%cc=address` instead. ACCESS ------ @@ -64,32 +48,30 @@ Send a review for a change on the master branch to charlie@example.com: ===== - git push --receive-pack='git receive-pack --reviewer charlie@example.com' ssh://review.example.com:29418/project HEAD:refs/for/master + git push ssh://review.example.com:29418/project HEAD:refs/for/master%r=charlie@example.com ===== Send reviews, but tagging them with the topic name 'bug42': ===== - git push --receive-pack='git receive-pack --reviewer charlie@example.com' ssh://review.example.com:29418/project HEAD:refs/for/master/bug42 + git push ssh://review.example.com:29418/project HEAD:refs/for/master%r=charlie@example.com,topic=bug42 ===== Also CC two other parties: ===== - git push --receive-pack='git receive-pack --reviewer charlie@example.com --cc alice@example.com --cc bob@example.com' ssh://review.example.com:29418/project HEAD:refs/for/master + git push ssh://review.example.com:29418/project HEAD:refs/for/master%r=charlie@example.com,cc=alice@example.com,cc=bob@example.com ===== Configure a push macro to perform the last action: ==== git config remote.charlie.url ssh://review.example.com:29418/project - git config remote.charlie.push HEAD:refs/for/master - git config remote.charlie.receivepack 'git receive-pack --reviewer charlie@example.com --cc alice@example.com --cc bob@example.com' + git config remote.charlie.push HEAD:refs/for/master%r=charlie@example.com,cc=alice@example.com,cc=bob@example.com ==== afterwards `.git/config` contains the following: ---- [remote "charlie"] url = ssh://review.example.com:29418/project - push = HEAD:refs/for/master - receivepack = git receive-pack --reviewer charlie@example.com --cc alice@example.com --cc bob@example.com + push = HEAD:refs/for/master%r=charlie@example.com,cc=alice@example.com,cc=bob@example.com ---- and now sending a new change for review to charlie, CC'ing both