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

Re: [PATCH] scalar: accept -C and -c options before the subcommand

From
Derrick Stolee <stolee@gmail.com>
Date
Jan 28, 2022, 19:38 UTC
Message-ID
<a41a53ac-cdaa-3e84-12de-703efed0ce78@gmail.com>
In-Reply-To
<xmqqv8y3wxas.fsf@gitster.g>
On 1/28/2022 1:05 PM, Junio C Hamano wrote:
Show 36 quoted lines
> Derrick Stolee <stolee@gmail.com> writes:
> 
>> My understanding was that this was ejected so we could find the right time
>> to lib-ify handle_options() (as Taylor suggested), but we didn't want to do
>> that while Scalar was still in a tentative state (in contrib/ with a plan
>> to move it out after more is implemented).
>>
>> The biggest benefits of using handle_options() is for other pre-command
>> options such as --exec-path, which I use on a regular basis when testing
>> new functionality.
>>
>> There are other options in handle_options() that might not be appropriate,
>> or might be incorrect if we just make handle_options() non-static. For
>> example, `scalar --list-cmds=parseopt` wouldn't show the scalar commands
>> and would instead show the git commands.
>>
>> So my feeling is that we should continue to delay this functionality until
>> Scalar is more stable, perhaps even until after it moves out of contrib/.
>> The need to change handle_options() to work with a new top-level command
>> is novel enough to be worth careful scrutiny, but that effort is only
>> valuable if the Git community is more committed to having Scalar in the
>> tree for the long term.
> 
> The usual caveat that little things tend to accumulate and you can
> die from thousands of paper cuts aside, if "run in that directory"
> and "pretend these configuration variables are set" are useful
> enough features to Scalar, I think that the straight-forward option
> parser this patch adds is very much acceptable.
> 
> If we need more options (i.e. when we need to add the third thing),
> that would be the best time to see how handle_options() can be
> restructured to serve the different set of options git and Scaler
> need.
> 
> And this loop, which is too small to be even called "duplicated
> implementation", should suffice in the meantime.
 
I have come around to this line of thinking. My response to Johannes'
detailed examination of my idea goes into that more deeply.
Thanks,
-Stolee
 
Previous: Junio C HamanoNext: Johannes Schindelin via GitGitGadget
Message 12 of 14 in “scalar: accept -C and -c options before the subcommand”
  1. scalar: accept -C and -c options before the subcommandJohannes Schindelin via GitGitGadget, Jan 26, 2022
  2. Taylor BlauJan 26, 2022
  3. Johannes SchindelinJan 28, 2022
  4. Ævar Arnfjörð BjarmasonJan 27, 2022
  5. Derrick StoleeJan 27, 2022
  6. Johannes SchindelinJan 28, 2022
  7. Ævar Arnfjörð BjarmasonJan 28, 2022
  8. Derrick StoleeJan 28, 2022
  9. Ævar Arnfjörð BjarmasonJan 29, 2022
  10. Derrick StoleeJan 28, 2022
  11. Junio C HamanoJan 28, 2022
  12. Derrick StoleeJan 28, 2022
  13. scalar: accept -C and -c options before the subcommandJohannes Schindelin via GitGitGadget, Jan 28, 2022
  14. Derrick StoleeJan 28, 2022

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.