How to specify multiple push options?

239 views
Skip to first unread message

Matthew Webber

unread,
Apr 17, 2018, 10:32:32 AM4/17/18
to Repo and Gerrit Discussion
The Gerrit documentation at https://gerrit-review.googlesource.com/Documentation/user-upload.html#push_options lists the various command line options when you push to Gerrit. Example:
git push origin HEAD:refs/for/experimental%topic=driver/i42

However, the documentation is not explicit on how to specify multiple options on the same push. It looks like you just comma-separate them, but can someone confirm that for definite? I''ll update the documentation when I have a confirmed answer.

Thanks
Matthew

Gert van Dijk

unread,
Apr 17, 2018, 10:35:59 AM4/17/18
to Repo and Gerrit Discussion
Just wanted to say that I really prefer the -o <push-option-string> syntax available with git 2.10+; you can then simply specify that option multiple times.

Stefan Beller

unread,
Apr 17, 2018, 1:43:31 PM4/17/18
to Gert van Dijk, Repo and Gerrit Discussion
I think you can give multiple percent signs
(or were the subsequent additional push options comma separated?)

I would also suggest to use gits native push options instead of Gerrits hack in
the ref space.

Doug Robinson

unread,
Apr 17, 2018, 2:46:03 PM4/17/18
to Repo and Gerrit Discussion
To answer the specific question, comma separated.  I've been doing:


Cheers.

Matthew Webber

unread,
Apr 18, 2018, 10:28:36 AM4/18/18
to Repo and Gerrit Discussion
I really prefer the -o <push-option-string> syntax
 
To answer the specific question, comma separated.

Thanks everyone, that works for me!
I'll tidy up the documentation when I get a chance.
Matthew

Gert van Dijk

unread,
Apr 18, 2018, 11:10:36 AM4/18/18
to Repo and Gerrit Discussion
On Wednesday, 18 April 2018 16:28:36 UTC+2, Matthew Webber wrote:
I'll tidy up the documentation when I get a chance.
Matthew

That would be nice - count me in to review your changes. :-)

Also, on a side note, with git 2.16+ you can now also configure push options like other git config settings. An example:

$ git config --local --add push.pushOption r=john.doe
$ git config --local --add push.pushOption r=foo.bar
$ git config --local --add push.pushOption private


(use case: working privately in a small group for a while in a repository.)
Reply all
Reply to author
Forward
0 new messages