git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin/push.c: add push.pushOption config

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2017, 01:33 UTC
Message-ID
<xmqqlgk5gu8t.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAK7vU=0m6qyFrPb9E7HY79v0Vxwn+So3gyhxJZBPVD1t7vX35A@mail.gmail.com>
Marius Paliga <marius.paliga@gmail.com> writes:
Show 12 quoted lines
> Should we also mention that this option can take multiple values from
> the command line?
>
> -o <option>::
> --push-option=<option>::
>         Transmit the given string to the server, which passes them to
>         the pre-receive as well as the post-receive hook. The given string
>         must not contain a NUL or LF character.
> +       Multiple `--push-option=<option>` are allowed on the command line.
>        When no `--push-option=<option>` is given from the command
>         line, the values of configuration variable `push.pushOption`
>         are used instead.

My first reaction was "Do we do that for other options that can be given multiple times? If not, perhaps this is not needed."

Then my second reaction was "Do we have that many options that can be given multiple times in the first place? If not, perhaps a change like this to highlight these oddball options may not be a bad idea."

And my third reaction was "Well, even if we have many such options, and even if most of them are not explicitly marked as usable multiple times in the current documentation, that's not a reason to keep it that way---the readers ought to be able to find out which ones can be used multiple times and how these multiple instances interact with each other, because the usual rule for single-instance options is 'the last one wins' (e.g. 'git status -uall -uno' should be the same as 'git status -uno') but to these multi-value options that rule does not hold".

So, yes, I think it is a good idea.

But it opens a tangent #leftoverbits. Among the most commonly used commands listed in "git --help", there indeed are some commands that take multiple options of the same kind (even if we do not count an obvious exception "--verbose", which everybody understands as the number of times it is given indicates the verbosity level). Somebody needs to go over their documentation and add "this can be given multiple times from the command line, and here is what happens to them".

In your suggestion for "push -o <value1> -o <value2>", "here is what happens" is missing. Perhaps

	When multiple `--push-option=<option>` are given, they are
	all sent to the other side in the order listed on the
	command line.
or something like that.
Thanks.
Previous: Marius PaligaNext: Stefan Beller
Message 10 of 14 in “Added support for new configuration parameter push.pushOption”
  1. Added support for new configuration parameter push.pushOptionMarius Paliga, Oct 17, 2017
  2. Junio C HamanoOct 18, 2017
  3. Junio C HamanoOct 18, 2017
  4. builtin/push.c: add push.pushOption configMarius Paliga, Oct 19, 2017
  5. Stefan BellerOct 19, 2017
  6. Junio C HamanoOct 20, 2017
  7. Junio C HamanoOct 20, 2017
  8. Junio C HamanoOct 20, 2017
  9. Marius PaligaOct 20, 2017
  10. Junio C HamanoOct 21, 2017
  11. Stefan BellerOct 20, 2017
  12. Junio C HamanoOct 21, 2017
  13. builtin/push.c: add push.pushOption configMarius Paliga, Oct 23, 2017
  14. Junio C HamanoOct 24, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.