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, 09:22 UTC
Message-ID
<20141204092251.GC27455@peff.net>
In-Reply-To
<xmqqd282m09j.fsf@gitster.dls.corp.google.com>
On Tue, Dec 02, 2014 at 09:26:00AM -0800, Junio C Hamano wrote:
Show 21 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > There is also "git var", which is a catch-all for printing some deduced
> > environmental defaults. I'd be just as happy to see it go away, though.
> > Having:
> >
> >   git --exec-path
> >   git --toplevel
> >   git --author-ident
> >
> > all work would make sense to me (I often get confused between "git
> > --foo" and "git rev-parse --foo" when trying to get the exec-path and
> > git-dir). And I don't think it's too late to move in this direction.
> > We'd have to keep the old interfaces around, of course, but it would
> > immediately improve discoverability and consistency.
> 
> Yeah, I too think the above makes sense.  I forgot about "var", but
> it should go at the same time we move kitchen-sink options out of
> "rev-parse".  One less command to worry about at the UI level means
> you do not have to say "if you want to learn about X, ask 'var', if
> you want to learn about Y, ask 'rev-parse', use 'git' itself for Z".

Christian raised the issue of cluttering the "git --option" namespace, and I do agree that's a potential issue. My proposal was to drop "git var", but I'd also be OK with making "git var" the new kitchen sink. It doesn't accept many options now, so it's fairly wide open for changing without losing backwards compatibility. AFAICT, the "-l" option is utterly useless, but other than that, it just takes a variable name. We could introduce dashed options, or just define a sane variable namespace.

Some of the discussion has involved mixing config options into this kitchen sink, but that does not make any sense to me (and is why I find "git var -l" so odd). Config options are fundamentally different, in that they are set and retrieved, not computed (from other config variables, or from hard-coded values). And we already have a nice tool for working with them (well...nice-ish, let's say).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 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.