Git: malformed content in ` /usr/share/vim/vim80/defaults.vim`

Created on 29 Nov 2017  路  9Comments  路  Source: git-for-windows/git

  • [x] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

Installer Git-2.15.1-64-bit.exe

$ git --version --build-options
git version 2.15.1.windows.1
built from commit: 81ab034ac9b601ef5a4f4ab53e910d9fe8047cb0
sizeof-long: 4
machine: x86_64
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.16299.64]
(c) 2017 Microsoft Corporation. All rights reserved.
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Editor Option: Nano
Path Option: Cmd
SSH Option: OpenSSH
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: ConHost
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

No.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Git Bash

$ vim
  • What did you expect to occur after running these commands?

vim opens without error

  • What actually happened instead?
$ vim
Error detected while processing /usr/share/vim/vim80/defaults.vim:
line  136:
E171: Missing :endif
Press ENTER or type command to continue

Looking at the file and the lines 112-135 it seems that each line is prefixed with a " which was probably inserted accidentally. I'm not sure if this comes from the upstream msys2 vim package or is introduced by git4win.

Could you please make a quick release, e.g. with an older vim package or a fixed default.vim?
Thank you!

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

No.

bug sdk-packages

Most helpful comment

  • Git-2.15.1.2-32-bit.exe: check
  • PortableGit-2.15.1.2-32-bit.7z.exe: check
  • Git-2.15.1.2-64-bit.exe: check
  • PortableGit-2.15.1.2-64-bit.7z.exe: check

Looks all good!

All 9 comments

Looking at the file and the lines 112-135 it seems that each line is prefixed with a " which was probably inserted accidentally.

I think you're correct.

I'm not sure if this comes from the upstream msys2 vim package or is introduced by git4win.

I am pretty sure that this was caused by an unfortunate side effect of an upgrade of MSYS2' vim updating the defaults.vim file in a way that our git-extra's post-install script does not handle correctly:

https://github.com/git-for-windows/build-extra/blob/dc78180fc204e53367e7981a912c0b33b9bb7dbc/git-extra/git-extra.install#L169-L173

The idea is to disable the global default of remembering the current line when closing and reopening files (which Git for Windows wants to override so that commit messages do not receive that handling).

Sadly, the sed expression is not specific enough, it seems.

I can confirm that it works now with a custom built installer (after pulling the git and build-extra repos and pacman -Syu).

Thanks!

@dscho, are you planning to release a new build today/tomorrow?
I'm holding a Software Carpentry workshop this weekend and would prefer to have the participants use an installer "von der Stange" ;-) instead of one that's custom built.

I can confirm that it works now with a custom built installer (after pulling the git and build-extra repos and pacman -Syu).

Great!

are you planning to release a new build today/tomorrow?

The artifacts are built as we speak; I will test them manually (in particular that vim works!!!) and then upload. It should not take more than 1h.

Vielen Dank und Sch枚ne Gr眉sse!

Uploading now... it'll take about 20 minutes in total.

Uploaded.

  • Git-2.15.1.2-32-bit.exe: check
  • PortableGit-2.15.1.2-32-bit.7z.exe: check
  • Git-2.15.1.2-64-bit.exe: check
  • PortableGit-2.15.1.2-64-bit.7z.exe: check

Looks all good!

sorry for chiming in, but with which Vim version did this happen? I am asking, because I thought I fixed this bug in Vim some time ago:
https://github.com/vim/vim/commit/9a48961d8bd7ffea14330b9b0181a
included as Vim patch 8.0.639

@chrisbra the problem was an unfortunate interaction between vim's defaults.vim and Git for Windows' attempts to avoid unfortunate defaults where vim tried to jump back to the last line when opened e.g. the commit message (which does not make sense because every commit message is separate from the previous ones).

So: @chrisbra no worries, Vim itself was not the culprit, at least not alone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Snaptags picture Snaptags  路  4Comments

educhana picture educhana  路  5Comments

JoshSchreuder picture JoshSchreuder  路  4Comments

t-b picture t-b  路  4Comments

drewnoakes picture drewnoakes  路  5Comments