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

Re: Enhancement request: git-push: Allow (configurable) default push-option

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2017, 00:37 UTC
Message-ID
<xmqq1sm7yjav.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAK7vU=0wbGsFCXmwmCc-XX9K07UF_OZ7tFa4_GVb-H7fxakssg@mail.gmail.com>
Marius Paliga <marius.paliga@gmail.com> writes:
Show 12 quoted lines
> Thank you for your coments and explanation.
>
> Just one thing:
>
>>  - After parse_options() returns to cmd_push(), see if push_options
>>    is empty.  If it is, you did not get any command line option, so
>>    override it with what you collected in the "from-config" string
>>    list.  Otherwise, do not even look at "from-config" string list.
>
> The idea is that there are default push options (read from config) that are
> always sent to the server and you can add (not overwrite) additional by
> specifying "--push-option".

I can imagine that sometimes giving a base from a configuration and then adding more for specific invocation may be useful.

But I do not think of any --command-line-option and config.variable pair whose configured value cannot be overriden by the command line option; we should strive to avoid making --push-option a special case that the users need to aware of, and more importantly, users other than you who expect the more usual "command line overrides" behaviour should get that.

Your "I wanted to accumulate, so I made so and made it impossible to override" won't fly as a justification. The default should be "command line overrides", and if you need a way to allow command line to add without overiding, that should be added as an optional feature.

	[alias]
		mypush = push --push-option=foo --push-option=bar

may give you a set of push-options that are always in effect (they are not even "by default") and cannot be overriden.

Previous: Junio C HamanoNext: Marius Paliga
Message 13 of 24 in “Enhancement request: git-push: Allow (configurable) default push-option”
  1. Marius PaligaOct 3, 2017
  2. Stefan BellerOct 3, 2017
  3. Marius PaligaOct 4, 2017
  4. Marius PaligaOct 11, 2017
  5. Marius PaligaOct 11, 2017
  6. Stefan BellerOct 11, 2017
  7. Junio C HamanoOct 11, 2017
  8. Junio C HamanoOct 11, 2017
  9. Marius PaligaOct 12, 2017
  10. Marius PaligaOct 12, 2017
  11. Stefan BellerOct 12, 2017
  12. Junio C HamanoOct 13, 2017
  13. Junio C HamanoOct 13, 2017
  14. Marius PaligaOct 13, 2017
  15. Thais D. Braz, Oct 11, 2017
  16. [Outreachy] New git config variable to specify string that will be automatically passed as --push-optionThais D. Braz, Oct 11, 2017
  17. Junio C HamanoOct 12, 2017
  18. Christian CouderOct 12, 2017
  19. Junio C HamanoOct 12, 2017
  20. patch replyThais Diniz, Oct 17, 2017
  21. Junio C HamanoOct 17, 2017
  22. Marius PaligaOct 17, 2017
  23. thais brazOct 17, 2017
  24. [Outreachy] New git config variable to specify string that will be automatically passed as --push-optionThais D. Braz, Oct 11, 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.