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

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

From
Stefan Beller <sbeller@google.com>
Date
Oct 3, 2017, 16:53 UTC
Message-ID
<CAGZ79kaBJnXW=rSiKuHpds79mXVL0Aoo+PBa0a5V-C_bop=Kbg@mail.gmail.com>
In-Reply-To
<CAK7vU=0ztEwMPsGO4Cd1A5JEnxmwkF57QPKjjvjD8rBUB79dRA@mail.gmail.com>
On Tue, Oct 3, 2017 at 3:15 AM, Marius Paliga <marius.paliga@gmail.com> wrote:
Show 15 quoted lines
> There is a need to pass predefined push-option during "git push"
> without need to specify it explicitly.
>
> In another words we need to have a new "git config" variable to
> specify string that will be automatically passed as "--push-option"
> when pushing to remote.
>
> Something like the following:
>
> git config push.optionDefault AllowMultipleCommits
>
> and then command
>   git push
> would silently run
>   git push --push-option "AllowMultipleCommits"
We would need to
* design this feature (seems like you already have a good idea what you need)
* implement it (see builtin/push.c):
 - move "struct string_list push_options = STRING_LIST_INIT_DUP;"
  to be a file-static variable, such that we have access to it outside
of cmd_push.
 - In git_push_config in builtin/push.c that parses the config, we'd
need to check
  for "push.optionDefault" and add these to the push_options (I assume multiple
  are allowed)
* document it (Documentation/git-push.txt)
* add a test for it ? (t/t5545-push-options.sh)

Care to write a patch? Otherwise I'd mark it up as part of #leftoverbits for now, as it seems like a good starter project.

Thanks, Stefan

Previous: Marius PaligaNext: Marius Paliga
Message 2 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.