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

Re: [PATCH 1/2] completion: merge options for cherry-pick and revert

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 26, 2019, 16:59 UTC
Message-ID
<xmqqftlnj20j.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<cdcac975548502a58234f7537a5fe11dcdb538ea.1566637431.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 6 quoted lines
> Since revert and cherry-pick share the same sequencer code, they should
> both accept the same command-line options. Merge the
> `__git_cherry_pick_inprogress_options` and
> `__git_revert_inprogress_options` variables together into
> `__git_cherry_pick_revert_inprogress_options` so that the options aren't
> unnecessarily duplicated twice.

Hmm, will the claim hold true in the future? I do agree that they will share continue, quit and abort (and skip) forever, but I am not bold enough to declare that they will never have some unique option in addition to the common one only because they "share the same sequencer" machinery. It is trivial to add a "if we are in revert, do this" to the code, and it already works that way.

__git_sequencer_inprogress_common_options="--continue --quit --abort" __git_cherry_pick_inprogress_options=$__git_sequencer_inprogress_common_options __git_revert_inprogress_options=$__git_sequencer_inprogress_common_options

may be a bit more future-proof way, perhaps? The places that use the variable(s) already correctly distinguish cherry-pick and revert, so even though the above and your version equally "unify" the set of common options and allow adding a new common option (i.e. skip) with equal ease, yours makes giving unique option to one but not to the other more difficult.

Previous: Denton LiuNext: Denton Liu
Message 4 of 12 in “completion: complete --skip for cherry-pick and revert”
  1. 0/2 completion: complete --skip for cherry-pick and revertDenton Liu, Aug 24, 2019
  2. 2/2 completion: add --skip for cherry-pick and revertDenton Liu, Aug 24, 2019
  3. 1/2 completion: merge options for cherry-pick and revertDenton Liu, Aug 24, 2019
  4. Junio C HamanoAug 26, 2019
  5. 0/3 advertise --skip for cherry-pick and revert betterDenton Liu, Aug 27, 2019
  6. 1/3 completion: merge options for cherry-pick and revertDenton Liu, Aug 27, 2019
  7. 2/3 completion: add --skip for cherry-pick and revertDenton Liu, Aug 27, 2019
  8. 3/3 status: mention --skip for revert and cherry-pickDenton Liu, Aug 27, 2019
  9. Junio C HamanoAug 27, 2019
  10. Denton LiuAug 27, 2019
  11. Junio C HamanoAug 28, 2019
  12. Denton LiuAug 28, 2019

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.