Skip to content

please.sh build-mingw-w64-git: configure the editor explicitly#685

Merged
dscho merged 1 commit intomainfrom
set-editor-when-building-mingw-w64-git
Mar 24, 2026
Merged

please.sh build-mingw-w64-git: configure the editor explicitly#685
dscho merged 1 commit intomainfrom
set-editor-when-building-mingw-w64-git

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Mar 24, 2026

For historical reasons, Git configures vi as the default editor, and the Git for Windows project followed suite.

As part of collaborating more closely with MSYS2, the mingw-w64-git package definition of Git for Windows is being synchronized between both projects. And MSYS2 has a different default editor, also for historical reasons: nano.

As a consequence, https://github.com/msys/MINGW-packages/aae0c9d1c8 (git: default to nano instead of vim (#28202), 2026-03-01) changed the package definition to build with nano as Git's default editor.

This hard-coded value would have prevented Git for Windows to maintain its default, and for that reason, the MSYS2 project added another commit, https://github.com/msys/MINGW-packages/d3ff7a1ec7 (git: allow _DEFAULT_EDITOR override, 2026-03-11), to allow Git for Windows to override that default.

This is what we do here: override the default, by setting _DEFAULT_EDITOR to vim.

Technically, this is a slight deviation from the previous default, which was vi. But the package definition uses this variable for two things: to tell Git's build process what the default editor is, and to add the corresponding package. But there is no vi package, only a vim one.

For historical reasons, Git configures `vi` as the default editor, and
the Git for Windows project followed suite.

As part of collaborating more closely with MSYS2, the `mingw-w64-git`
package definition of Git for Windows is being synchronized between
both projects. And MSYS2 has a different default editor, also for
historical reasons: `nano`.

As a consequence, https://github.com/msys/MINGW-packages/aae0c9d1c8
(git: default to nano instead of vim (#28202), 2026-03-01) changed the
package definition to build with `nano` as Git's default editor.

This hard-coded value would have prevented Git for Windows to maintain
_its_ default, and for that reason, the MSYS2 project added another
commit, https://github.com/msys/MINGW-packages/d3ff7a1ec7 (git: allow
_DEFAULT_EDITOR override, 2026-03-11), to allow Git for Windows to
override that default.

This is what we do here: override the default, by setting
`_DEFAULT_EDITOR` to `vim`.

Technically, this is a slight deviation from the previous default, which
was `vi`. But the package definition uses this variable for two things:
to tell Git's build process what the default editor is, and to add the
corresponding package. But there is no `vi` package, only a `vim` one:
https://github.com/msys2/MSYS2-packages/blob/HEAD/vim/PKGBUILD

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho merged commit 304b5f8 into main Mar 24, 2026
6 checks passed
@dscho dscho deleted the set-editor-when-building-mingw-w64-git branch March 24, 2026 14:10
dscho added a commit to git-for-windows/MINGW-packages that referenced this pull request Mar 24, 2026
There have been a couple of edits in upstream MSYS2 which we need to
integrate into Git for Windows' fork, lest the next Git for Windows
version sync will overwrite those edits.

This change requires
git-for-windows/build-extra#685 to be merged
first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants