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

Re: default editor

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Feb 7, 2021, 17:35 UTC
Message-ID
<YCAk8Zx8KvZhaJMx@camp.crustytoothpaste.net>
In-Reply-To
<CAKH6PiWS5DvqctFnvZ+uyOzBs75hcy9HzbW_3gUCu+RE+oOYyw@mail.gmail.com>
On 2021-02-07 at 13:24:07, M Douglas McIlroy wrote:
Show 6 quoted lines
> While downloading git, I was asked to name a default editor, which I
> did: ed. from cygwin. It worked in the enuing test, but was rejected
> because it returned an error. I suppose this is because
> cygwin return  conventions are those of Unix, not Windows. That raises
> the question: does it matter? Does any other part of git depend on the
> editor's return value?

First of all, I don't use Windows and this sounds like a Windows-specific problem, so you may have more help at the Git for Windows issue tracker. But I'll try to help anyway.

At the command line, what does "git var GIT_EDITOR" print? Is it "/usr/bin/ed" or the like? Or is it something like "/c/..."? Also, what is the exact error message you receive from trying to run your command (copy and paste)?

The reason I ask is that Git for Windows ships with a POSIX-like environment called MSYS, and as such, Unix-style paths are interpreted according to that. So to specify a path for Cygwin, you'd need to specify it as a Unix-style path under /c (or /d, or whatever drive) so that it could be invoked as a normal Windows program and not something relative to the MSYS environment. However, the path is handed off to the shell, so it needs to be in a form that uses slashes.

I don't think the return value is the problem. Both Unix and Windows return 0 on success and nonzero on error, and Git will interpret editor return codes that way.

-- 
brian m. carlson (he/him or they/them)
Houston, Texas, US
Previous: M Douglas McIlroyNext: Junio C Hamano
Message 2 of 9 in “default editor”
  1. M Douglas McIlroyFeb 7, 2021
  2. brian m. carlsonFeb 7, 2021
  3. Junio C HamanoFeb 7, 2021
  4. Jeff KingFeb 7, 2021
  5. brian m. carlsonFeb 7, 2021
  6. Eric SunshineFeb 7, 2021
  7. Adam DinwoodieFeb 8, 2021
  8. M Douglas McIlroyFeb 11, 2021
  9. Eric SunshineFeb 12, 2021

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.