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

Re: git notes and core.editor config

From
Jeenu V <jeenuv@gmail.com>
Date
Jan 11, 2011, 11:14 UTC
Message-ID
<AANLkTik-=s-F8dmBRLU8o9LcSztb1P0WnkN5HK_n_No4@mail.gmail.com>
In-Reply-To
<201101111131.17429.johan@herland.net>
On Tue, Jan 11, 2011 at 4:01 PM, Johan Herland <johan@herland.net> wrote:
Show 29 quoted lines
> On Tuesday 11 January 2011, Jeenu V wrote:
>> My core.editor value in $HOME/.gitconfig is set to
>>
>>   [core]
>>       editor = vi "+set tw=72 spell"
>>
>> so that I've text width of 72 with spell check turned on. I haven't
>> found problems with any git commands that invoke editor, but notes.
>> 'git notes' seems to invoke the vi for me with 3 separate arguments
>> instead of just one: "+set, tw=72, and spell". In other words, I
>> don't think it honors shell quoting for editor config variable.
>>
>> Could this be a bug?
>
> Indeed, it could, but I cannot immediately see what causes it. In
> current 'master', builtin/notes.c launches the editor like this:
>
>  if (launch_editor(path, &(msg->buf), NULL)) ...
>
> while builtin/commit.c lauches the editor like this:
>
>  if (launch_editor(git_path(commit_editmsg), NULL, env)) ...
>
> In both cases, the details of interpreting core.editor is left to
> git_default_core_config(), and passed to launch_editor() using the
> editor_program global variable. AFAICS there is no difference between
> how "notes" and "commit" interprets core.editor.
>
> What Git version are you running?

$ git --version git version 1.7.0.4

-- 
Jeenu
Previous: Johan HerlandNext: Thomas Rast
Message 3 of 6 in “git notes and core.editor config”
  1. Jeenu VJan 11, 2011
  2. Johan HerlandJan 11, 2011
  3. Jeenu VJan 11, 2011
  4. Thomas RastJan 11, 2011
  5. Johan HerlandJan 11, 2011
  6. Jeenu VJan 11, 2011

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.