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

Re: [PATCH] Add git-sh-setup::set_editor()

From
David Kastrup <dak@gnu.org>
Date
Jul 19, 2007, 19:26 UTC
Message-ID
<86tzs0yz27.fsf@lola.quinscape.zz>
In-Reply-To
<Pine.LNX.4.64.0707191944560.14781@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 20 quoted lines
> On Thu, 19 Jul 2007, Adam Roben wrote:
>
>> This function can be used to set the GIT_EDITOR variable to the user's
>> preferred editor.
>
> Much nicer, thank you.
>
> However,
>
>> -	commit_editor=$(git config core.editor || echo ${VISUAL:-$EDITOR})
>> -	case "$commit_editor,$TERM" in
>> +	case "$GIT_EDITOR,$TERM" in
>>  	,dumb)
>
> This can no longer happen, since ...
>
>> +set_editor() {
>> +    GIT_EDITOR=$(git config core.editor || echo ${VISUAL:-${EDITOR:-vi}})
>> +    export GIT_EDITOR
>> +}

Strictly speaking it can happen when git has an empty string for core.editor configured. Not that the behavior chosen in this case would make any sense, but just for the record...

-- 
David Kastrup
Previous: Johannes SchindelinNext: Adam Roben
Message 9 of 14 in “Add commit.editor configuration variable”
  1. Add commit.editor configuration variableAdam Roben, Jul 19, 2007
  2. Junio C HamanoJul 19, 2007
  3. Adam RobenJul 19, 2007
  4. Shawn O. PearceJul 19, 2007
  5. Junio C HamanoJul 19, 2007
  6. Johannes SchindelinJul 19, 2007
  7. Add git-sh-setup::set_editor()Adam Roben, Jul 19, 2007
  8. Johannes SchindelinJul 19, 2007
  9. David KastrupJul 19, 2007
  10. Print an error when falling back to vi on a dumb terminalAdam Roben, Jul 19, 2007
  11. Johannes SchindelinJul 19, 2007
  12. Junio C HamanoJul 20, 2007
  13. Add core.editor configuration variableAdam Roben, Jul 20, 2007
  14. Add GIT_EDITOR environment variable and core.editor configuration variableAdam Roben, Jul 20, 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.