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

Re: couple questions about git "logical variables" and "git var"

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 6, 2017, 02:35 UTC
Message-ID
<20171006023530.GA134987@aiede.mtv.corp.google.com>
In-Reply-To
<20171005095636.mpp2ohf7vp7mtzeb@sigill.intra.peff.net>
Jeff King wrote:
> On Thu, Oct 05, 2017 at 05:11:04AM -0400, rpjday@crashcourse.ca wrote:
Show 17 quoted lines
>>  - GIT_AUTHOR_IDENT
>>  - GIT_COMMITTER_IDENT
>>  - GIT_EDITOR
>>  - GIT_PAGER
>>
>> first question -- what is it about precisely those four variables that makes
>> them "logical" variables in git parlance? just those four? no others?
>
> It was introduced in the very early days as a way for scripts to get
> access to "standard" values that would be computed the same way as the C
> portions of Git.  But it hasn't generally been kept up to date with new
> possible variables.
>
> It also only tells half the story. You have to know not just what's in
> $GIT_EDITOR, but you have to know the right way to evaluate it. There's
> a git_editor helper in git-sh-setup, but other scripting languages are
> on their own.
I am not sure I understand the complaint here.  git-var(1) says:
	GIT_EDITOR
	   Text editor for use by Git commands. The value is meant to be
	   interpreted by the shell when it is used. Examples: [...]

Are you saying that the output of the command should quote that manpage, so as to tell the rest of the story?

>               We'd probably have done better to introduce a "git editor"
> command which can be run from any language.

I remember that we discussed this at the time but don't remember why it didn't happen. It seems like a good idea.

[...]
Show 5 quoted lines
>> p.s. yes, i realize this command is deprecated in favour of "git config -l",
>> but as long as it's available, it should work as described in the man page.
>
> Yes, though I think fixing the manpage is the right way to make them
> consistent.
Agreed as well.  rday, care to take a stab at wording?

Thanks, Jonathan

Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “couple questions about git "logical variables" and "git var"”
  1. rpjday@crashcourse.caOct 5, 2017
  2. Jeff KingOct 5, 2017
  3. Jonathan NiederOct 6, 2017
  4. Jeff KingOct 6, 2017

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.