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

Re: [PATCH v2 3/8] Teach git var about GIT_EDITOR

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2009, 02:34 UTC
Message-ID
<7vws2cb8bp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20091031022347.GA5569@progeny.tock>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 56 quoted lines
> Junio C Hamano wrote:
>
>>> 	core.logallrefupdates=true
>>>
>>> 	*** Please tell me who you are.
>>>
>>> 	Run
>>>
>>> 	  git config --global user.email "you@example.com"
>>> 	  git config --global user.name "Your Name"
>>>
>>> 	to set your account's default identity.
>>> 	Omit --global to set the identity only in this repository.
>>>
>>> 	GIT_COMMITTER_IDENT=user <user@domain> 1256952739 -0500
>>> 	GIT_AUTHOR_IDENT=user <user@domain> 1256952739 -0500
>>> 	warning: GIT_EDITOR: terminal is dumb, but EDITOR unset
>> 
>> Sorry, I cannot grok this example.  Is it supposed to be a transcript
>> of a user session?  What did the user type?
>
> Oh, sorry about that.  The user typed 'git var -l', and that is all
> output from that.  More realistic examples:
>
> $ # what scripts see
> $ git var -l 2>/dev/null
> gc.auto=0
> rerere.enabled
> merge.log
> merge.conflictstyle=diff3
> core.repositoryformatversion=0
> core.filemode=true
> core.bare=false
> core.logallrefupdates=true
> remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
> remote.origin.url=git://repo.or.cz/git
> branch.master.remote=origin
> branch.master.merge=refs/heads/master
> GIT_COMMITTER_IDENT=user <user@domain> 1256952739 -0500
> GIT_AUTHOR_IDENT=user <user@domain> 1256952739 -0500
> $
> $ # what scripts pass on to the user
> $ git var -l >/dev/null
>
> *** Please tell me who you are.
>
> Run
>
>   git config --global user.email "you@example.com"
>   git config --global user.name "Your Name"
>
> to set your account's default identity.
> Omit --global to set the identity only in this repository.
>
> warning: GIT_EDITOR: terminal is dumb, but EDITOR unset
> $ 
This is more readable.

But the user did not even ask for GIT_EDITOR. Should it even mention "unusable"? or should it just say something like

	GIT_EDITOR=
without complaining?

For that matter, I also wonder if we can squelch the user.email one when we are only listing the variables (I know it is not part of this topic, but I can still wonder).

> Would a more friendly message be helpful here?  I am not sure how 'git
> var -l' gets used.  I never liked using it directly myself, mostly
> because the long list of configuration items can be overwhelming.

I think people run "git var -l", store the results in variables (think Perl or Python script) and read from there, instead of making separate invocations of "git var" for individual variables.

Previous: Jonathan NiederNext: Jonathan Nieder
Message 36 of 65 in “packaging vs default pager”
  1. Ben WaltonOct 28, 2009
  2. Junio C HamanoOct 28, 2009
  3. 0/2 Re: packaging vs default pagerJonathan Nieder, Oct 29, 2009
  4. 1/2 Provide a build time default-pager settingJonathan Nieder, Oct 29, 2009
  5. 2/2 Provide a build time default-editor settingJonathan Nieder, Oct 29, 2009
  6. David RoundyOct 29, 2009
  7. Johannes SixtOct 29, 2009
  8. Junio C HamanoOct 29, 2009
  9. Johannes SixtOct 29, 2009
  10. Junio C HamanoOct 29, 2009
  11. David RoundyOct 30, 2009
  12. Junio C HamanoOct 29, 2009
  13. 0/8 Default pager and editorJonathan Nieder, Oct 30, 2009
  14. 1/8 launch_editor: Longer error message when TERM=dumbJonathan Nieder, Oct 30, 2009
  15. 2/8 Handle more shell metacharacters in editor namesJonathan Nieder, Oct 30, 2009
  16. 3/8 Teach git var about GIT_EDITORJonathan Nieder, Oct 30, 2009
  17. Johannes SixtOct 30, 2009
  18. Jonathan NiederOct 30, 2009
  19. Junio C HamanoOct 30, 2009
  20. Jonathan NiederOct 31, 2009
  21. 4/8 Teach git var about GIT_PAGERJonathan Nieder, Oct 30, 2009
  22. 5/8 add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"Jonathan Nieder, Oct 30, 2009
  23. 6/8 am -i, git-svn: use "git var GIT_PAGER"Jonathan Nieder, Oct 30, 2009
  24. 7/8 Provide a build time default-editor settingJonathan Nieder, Oct 30, 2009
  25. Jonathan NiederOct 30, 2009
  26. 8/8 Provide a build time default-pager settingJonathan Nieder, Oct 30, 2009
  27. Junio C HamanoOct 30, 2009
  28. 9/8 Teach git var to run the editorJonathan Nieder, Oct 30, 2009
  29. 0/8 Default pager and editorJonathan Nieder, Oct 31, 2009
  30. 1/8 Handle more shell metacharacters in editor namesJonathan Nieder, Oct 31, 2009
  31. 2/8 Do not use VISUAL editor on dumb terminalsJonathan Nieder, Oct 31, 2009
  32. 2/8 Do not use VISUAL editor on dumb terminalsJonathan Nieder, Oct 31, 2009
  33. 3/8 Teach git var about GIT_EDITORJonathan Nieder, Oct 31, 2009
  34. Junio C HamanoOct 31, 2009
  35. Jonathan NiederOct 31, 2009
  36. Junio C HamanoOct 31, 2009
  37. Jonathan NiederOct 31, 2009
  38. Teach git var about GIT_EDITORJonathan Nieder, Oct 31, 2009
  39. Jonathan NiederOct 31, 2009
  40. Teach git var about GIT_EDITORJonathan Nieder, Oct 31, 2009
  41. Junio C HamanoNov 1, 2009
  42. Johannes SixtOct 31, 2009
  43. 4/8 Teach git var about GIT_PAGERJonathan Nieder, Oct 31, 2009
  44. 5/8 add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"Jonathan Nieder, Oct 31, 2009
  45. 6/8 am -i, git-svn: use "git var GIT_PAGER"Jonathan Nieder, Oct 31, 2009
  46. 7/8 Provide a build time default-editor settingJonathan Nieder, Oct 31, 2009
  47. Junio C HamanoOct 31, 2009
  48. Jonathan NiederOct 31, 2009
  49. Junio C HamanoOct 31, 2009
  50. Jonathan NiederOct 31, 2009
  51. Junio C HamanoNov 1, 2009
  52. 8/8 Provide a build time default-pager settingJonathan Nieder, Oct 31, 2009
  53. 0/9 Default pager and editorJonathan Nieder, Nov 11, 2009
  54. 1/9 Handle more shell metacharacters in editor namesJonathan Nieder, Nov 11, 2009
  55. 2/9 Do not use VISUAL editor on dumb terminalsJonathan Nieder, Nov 11, 2009
  56. 3/9 Suppress warnings from "git var -l"Jonathan Nieder, Nov 11, 2009
  57. 4/9 Teach git var about GIT_EDITORJonathan Nieder, Nov 12, 2009
  58. 5/9 Teach git var about GIT_PAGERJonathan Nieder, Nov 12, 2009
  59. 6/9 add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"Jonathan Nieder, Nov 12, 2009
  60. 7/9 am -i, git-svn: use "git var GIT_PAGER"Jonathan Nieder, Nov 12, 2009
  61. 8/9 Provide a build time default-editor settingJonathan Nieder, Nov 12, 2009
  62. 9/9 Provide a build time default-pager settingJonathan Nieder, Nov 12, 2009
  63. Junio C HamanoNov 15, 2009
  64. 0/2 Default Pager and Editor at build-timeBen Walton, Oct 29, 2009
  65. 1/2 Provide a build time default-pager settingBen Walton, Oct 29, 2009

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.