{"thread":{"id":"26256","subject":"git notes and core.editor config","startedAt":"2011-01-11T10:11:40Z","lastAt":"2011-01-11T13:12:20Z","messageCount":6,"participants":["Jeenu V","Johan Herland","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159315","messageId":"AANLkTi=0BrBV+DLF_QfDi0mMVdz5tCLFsDMBKvw52nzz@mail.gmail.com","threadId":"26256","inReplyTo":null,"subject":"git notes and core.editor config","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2011-01-11T10:11:40Z","receivedAt":"2011-01-11T10:11:40Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"My core.editor value in $HOME/.gitconfig is set to\n\n  [core]\n      editor = vi \"+set tw=72 spell\"\n\nso that I've text width of 72 with spell check turned on. I haven't\nfound problems with any git commands that invoke editor, but notes.\n'git notes' seems to invoke the vi for me with 3 separate arguments\ninstead of just one: \"+set, tw=72, and spell\". In other words, I don't\nthink it honors shell quoting for editor config variable.\n\nCould this be a bug?\n\n-- \nJeenu\n"},{"id":"159316","messageId":"201101111131.17429.johan@herland.net","threadId":"26256","inReplyTo":"AANLkTi=0BrBV+DLF_QfDi0mMVdz5tCLFsDMBKvw52nzz@mail.gmail.com","subject":"Re: git notes and core.editor config","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2011-01-11T10:31:17Z","receivedAt":"2011-01-11T10:31:17Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tuesday 11 January 2011, Jeenu V wrote:\n> My core.editor value in $HOME/.gitconfig is set to\n>\n>   [core]\n>       editor = vi \"+set tw=72 spell\"\n>\n> so that I've text width of 72 with spell check turned on. I haven't\n> found problems with any git commands that invoke editor, but notes.\n> 'git notes' seems to invoke the vi for me with 3 separate arguments\n> instead of just one: \"+set, tw=72, and spell\". In other words, I\n> don't think it honors shell quoting for editor config variable.\n>\n> Could this be a bug?\n\nIndeed, it could, but I cannot immediately see what causes it. In \ncurrent 'master', builtin/notes.c launches the editor like this:\n\n  if (launch_editor(path, &(msg->buf), NULL)) ...\n\nwhile builtin/commit.c lauches the editor like this:\n\n  if (launch_editor(git_path(commit_editmsg), NULL, env)) ...\n\nIn both cases, the details of interpreting core.editor is left to \ngit_default_core_config(), and passed to launch_editor() using the \neditor_program global variable. AFAICS there is no difference between \nhow \"notes\" and \"commit\" interprets core.editor.\n\nWhat Git version are you running?\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"159319","messageId":"AANLkTik-=s-F8dmBRLU8o9LcSztb1P0WnkN5HK_n_No4@mail.gmail.com","threadId":"26256","inReplyTo":"201101111131.17429.johan@herland.net","subject":"Re: git notes and core.editor config","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2011-01-11T11:14:21Z","receivedAt":"2011-01-11T11:14:21Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"On Tue, Jan 11, 2011 at 4:01 PM, Johan Herland <johan@herland.net> wrote:\n> On Tuesday 11 January 2011, Jeenu V wrote:\n>> My core.editor value in $HOME/.gitconfig is set to\n>>\n>>   [core]\n>>       editor = vi \"+set tw=72 spell\"\n>>\n>> so that I've text width of 72 with spell check turned on. I haven't\n>> found problems with any git commands that invoke editor, but notes.\n>> 'git notes' seems to invoke the vi for me with 3 separate arguments\n>> instead of just one: \"+set, tw=72, and spell\". In other words, I\n>> don't think it honors shell quoting for editor config variable.\n>>\n>> Could this be a bug?\n>\n> Indeed, it could, but I cannot immediately see what causes it. In\n> current 'master', builtin/notes.c launches the editor like this:\n>\n>  if (launch_editor(path, &(msg->buf), NULL)) ...\n>\n> while builtin/commit.c lauches the editor like this:\n>\n>  if (launch_editor(git_path(commit_editmsg), NULL, env)) ...\n>\n> In both cases, the details of interpreting core.editor is left to\n> git_default_core_config(), and passed to launch_editor() using the\n> editor_program global variable. AFAICS there is no difference between\n> how \"notes\" and \"commit\" interprets core.editor.\n>\n> What Git version are you running?\n\n$ git --version\ngit version 1.7.0.4\n\n-- \nJeenu\n"},{"id":"159322","messageId":"201101111326.02277.trast@student.ethz.ch","threadId":"26256","inReplyTo":"AANLkTik-=s-F8dmBRLU8o9LcSztb1P0WnkN5HK_n_No4@mail.gmail.com","subject":"Re: git notes and core.editor config","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2011-01-11T12:26:02Z","receivedAt":"2011-01-11T12:26:02Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Jeenu V wrote:\n> On Tue, Jan 11, 2011 at 4:01 PM, Johan Herland <johan@herland.net> wrote:\n> >> In other words, I\n> >> don't think [git-notes] honors shell quoting for editor config variable.\n> >\n> > Indeed, it could, but I cannot immediately see what causes it. In\n> > current 'master', builtin/notes.c launches the editor like this:\n> >\n> >  if (launch_editor(path, &(msg->buf), NULL)) ...\n> >\n> > while builtin/commit.c lauches the editor like this:\n> >\n> >  if (launch_editor(git_path(commit_editmsg), NULL, env)) ...\n[...]\n> $ git --version\n> git version 1.7.0.4\n\ngit-notes was a script before 1.7.1, and that was indeed buggy in that\nit used the editor as\n\n  ${GIT_EDITOR:-${core_editor:-${VISUAL:-${EDITOR:-vi}}}} \"$MSG_FILE\"\n\ninstead of using git_editor() from git-sh-setup, which would have gone\nthrough eval.\n\nThe builtin version of git-notes does not have this problem.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"159325","messageId":"201101111336.19466.johan@herland.net","threadId":"26256","inReplyTo":"AANLkTik-=s-F8dmBRLU8o9LcSztb1P0WnkN5HK_n_No4@mail.gmail.com","subject":"Re: git notes and core.editor config","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2011-01-11T12:36:19Z","receivedAt":"2011-01-11T12:36:19Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Tuesday 11 January 2011, Jeenu V wrote:\n> On Tue, Jan 11, 2011 at 4:01 PM, Johan Herland <johan@herland.net> \nwrote:\n> > On Tuesday 11 January 2011, Jeenu V wrote:\n> >> My core.editor value in $HOME/.gitconfig is set to\n> >>\n> >>   [core]\n> >>       editor = vi \"+set tw=72 spell\"\n> >>\n> >> so that I've text width of 72 with spell check turned on. I\n> >> haven't found problems with any git commands that invoke editor,\n> >> but notes. 'git notes' seems to invoke the vi for me with 3\n> >> separate arguments instead of just one: \"+set, tw=72, and spell\".\n> >> In other words, I don't think it honors shell quoting for editor\n> >> config variable.\n> >>\n> >> Could this be a bug?\n> >\n> > What Git version are you running?\n>\n> $ git --version\n> git version 1.7.0.4\n\nAh, there's your problem. In v1.7.1 \"git notes\" was builtin-ified (it \nused to be a shell script, but was reimplemented in C), so you're still \nrunning the shell script version of \"git notes\". I believe upgrading \nwill solve your problem (as well as making \"git notes\" more \nfeatureful).\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"159329","messageId":"AANLkTikYxncadDj_6k+kDVz63_abhud5w8v-WgFmOA92@mail.gmail.com","threadId":"26256","inReplyTo":"201101111336.19466.johan@herland.net","subject":"Re: git notes and core.editor config","fromName":"Jeenu V","fromEmail":"jeenuv@gmail.com","sentAt":"2011-01-11T13:12:20Z","receivedAt":"2011-01-11T13:12:20Z","isPatch":false,"sender":{"key":"jeenuv@gmail.com","avatar":"https://gravatar.com/avatar/0fae51e727209ba442f53fbab775dec62add0884f7a1bf1eb9fee94fb876f2b0?d=mp&s=160"},"body":"On Tue, Jan 11, 2011 at 6:06 PM, Johan Herland <johan@herland.net> wrote:\n>> $ git --version\n>> git version 1.7.0.4\n>\n> Ah, there's your problem. In v1.7.1 \"git notes\" was builtin-ified (it\n> used to be a shell script, but was reimplemented in C), so you're still\n> running the shell script version of \"git notes\". I believe upgrading\n> will solve your problem (as well as making \"git notes\" more\n> featureful).\n>\n\nAlright, I'll try upgrading then. Thanks.\n\n-- \nJeenu\n"}]}