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

Re: [PATCH] introduce git root

From
Jeff King <peff@peff.net>
Date
Dec 4, 2014, 21:12 UTC
Message-ID
<20141204211232.GC19953@peff.net>
In-Reply-To
<xmqqlhmntf02.fsf@gitster.dls.corp.google.com>
On Thu, Dec 04, 2014 at 11:02:37AM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> > Christian raised the issue of cluttering the "git --option" namespace,
> > and I do agree that's a potential issue. 
> 
> I am not sure if that is an issue at all.  You will need the same
> number of options to cover all the necessary "computables" somewhere
> anyway.
> 
> "git --show-this-or-that-computable" is not more or not less
> cluttering compared to "git var --show-this-or-that-computable".

My issue is only that "git --foo" has other options besides computables. So you need to name each option in a way that makes it clear it is reporting a computable and not doing something else.

Take "git --pager" for instance. That would be a natural choice to replace "git var GIT_PAGER". But shouldn't "--pager" be the opposite of the existing "--no-pager"?

So instead we probably need some namespace to indicate that it is a "showing" option. Like "--show-pager". And then for consistency, we would probably want to move "--exec-path" to "--show-exec-path", creating a new "--show-" namespace. Or we could call that namespace "git var". :)

Show 11 quoted lines
> I understand we are not talking about removing "git --exec-path",
> but the desire is to have one single command the user can go to ask
> about all the computables.  If "var" is to become that single
> command, then we need to keep the interface to it uniform and
> consistent, and telling the users to use "git var GIT_PAGER" and
> "git var --exec-path" in the same script will not fly well.  Also
> these GIT_$COMPUTABLE_NAME appear as if they can be influenced by
> setting environment variables of the same name, which invites
> further confusion.  This is especially bad because some of then do
> get affected by environment (i.e. GIT_EDITOR="vi" has effect, but
> GIT_AUTHOR_IDENT="Gitster <gitster@pobox.com>" does not).

I do not think "git var --exec-path" is a good idea, nor GIT_EXEC_PATH for the environment-variable confusion you mentioned. I was thinking of just creating a new namespace, like:

  git var exec-path
  git var author-ident
and deprecating the 4 existing GIT_* variables.
Show 5 quoted lines
> If we admit that "git var" was a failed experiment that gained only
> four fake variables for the past 10 years, it will not be too much
> trouble and transition pain to turn the existing ones into option
> form, like --author-ident etc., like your original proposal did, I
> would think.

I am also OK with that, if the details turn out to be not too ugly once somebody starts digging in. I was just anticipating some ugliness in advance. :) But I am not planning to work on it in the immediate future, so whoever does can make that call.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 23 in “introduce git root”
  1. introduce git rootArjun Sreedharan, Nov 29, 2014
  2. Philip OakleyNov 29, 2014
  3. Arjun SreedharanNov 30, 2014
  4. Matthieu MoyNov 30, 2014
  5. Junio C HamanoDec 1, 2014
  6. Christian CouderDec 1, 2014
  7. Junio C HamanoDec 1, 2014
  8. Jeff KingDec 2, 2014
  9. Christian CouderDec 2, 2014
  10. Junio C HamanoDec 2, 2014
  11. Jeff KingDec 4, 2014
  12. Junio C HamanoDec 4, 2014
  13. Matthieu MoyDec 4, 2014
  14. Junio C HamanoDec 4, 2014
  15. Jeff KingDec 4, 2014
  16. Junio C HamanoDec 4, 2014
  17. Christian CouderDec 5, 2014
  18. Jeff KingDec 5, 2014
  19. Christian CouderDec 7, 2014
  20. Junio C HamanoDec 9, 2014
  21. Christian CouderDec 10, 2014
  22. Jeff KingDec 10, 2014
  23. Junio C HamanoDec 10, 2014

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.