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

Re: [RFC PATCH 0/1] push: introduce '--heads' option

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2023, 18:48 UTC
Message-ID
<xmqq7ctvetbo.fsf@gitster.g>
In-Reply-To
<20230428095955.66292-1-tenglong.tl@alibaba-inc.com>
Teng Long <dyroneteng@gmail.com> writes:
> ZheNing Hu mentioned me that could use "OPT_ALIAS" instead, it seems
> like could be better than OPT_BIT in this scenario. If so, are problems
> that may arise from interactions shielded? If not, I'm willing to add
> extra test about it (some relevant advice if possible).

The intent of ALIAS is to just add an extra option visible at the UI level that behaves exactly the same as the other one at the code level, so the codepath that is prepared to deal with one can handle the other one without any extra effort. In fact, after the option parsing is finished, the rest of the code should not even be able to tell which one, the original or the alias, was used on the command line.

And in this case, you'd want a new "push all branches" option that behaves exactly like existing "--all", and possibly you may over time want to deprecate the latter. All the code to ensure how "--all" should interact with other options should be working fine (or if there is a bug, that needs to be corrected whether we would add this alias or not).

Sounds like a very good plan to me.
Thanks.
Previous: Teng LongNext: Teng Long
Message 13 of 18 in “push: introduce '--heads' option”
  1. 0/1 push: introduce '--heads' optionTeng Long, Dec 5, 2022
  2. 1/1 push: introduce '--heads' optionTeng Long, Dec 5, 2022
  3. ZheNing HuDec 5, 2022
  4. Teng LongDec 6, 2022
  5. Felipe ContrerasApr 28, 2023
  6. Teng LongApr 30, 2023
  7. 0/1 push: introduce '--branches' optionTeng Long, May 6, 2023
  8. 1/1 push: introduce '--branches' optionTeng Long, May 6, 2023
  9. 0/1 push: introduce '--branches' optionTeng Long, May 6, 2023
  10. Junio C HamanoDec 5, 2022
  11. Teng LongDec 15, 2022
  12. Teng LongApr 28, 2023
  13. Junio C HamanoApr 28, 2023
  14. Teng LongApr 30, 2023
  15. 0/1 push: introduce '--branches' optionTeng Long, May 6, 2023
  16. 1/1 push: introduce '--branches' optionTeng Long, May 6, 2023
  17. Junio C HamanoMay 6, 2023
  18. Teng LongMay 7, 2023

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.