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

[RFC] Default options

From
DHDana How <danahow@gmail.com>
Date
May 9, 2007, 22:15 UTC
Message-ID
<56b7f5510705091515l7c7090b9rd5599e8746642ef9@mail.gmail.com>

Reading the exchange about new options to e.g. git gc and git pack-objects over the last few days, a pattern seemed to emerge. A new option would be proposed, but then we didn't always want to type it, so a corresponding config variable would be added as well.

I notice git supports "alias.*" config variables.
Would it be useful to also support "options.*" variables?
When you type
    git gc <args>
this is interpreted as
    git gc $(git config options.gc) <args>
so anything in options.gc could be overridden
by later appearing on the command line.
The names might have dashes:
pack-objects would use options.pack-objects .

If a command is recognized using alias.*, options.* would not be consulted (to keep things simple). In other words, options.* only work for built-ins. options.* would interpret quoting etc in its value the same way alias.* does.

Thus, you can add a new --option to a program, and get a corresponding config variable automatically, and without cluttering up the documentation.

I've not yet looked at the git driver code. Is there any interest in this feature?

Thanks,
-- 
Dana L. How  danahow@gmail.com  +1 650 804 5991 cell
Next: Johannes Schindelin
Message 1 of 3 in “[RFC] Default options”
  1. Dana HowMay 9, 2007
  2. Johannes SchindelinMay 9, 2007
  3. Matthieu MoyMay 9, 2007

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.