Git: `/usr/share/nano/git.nanorc` uses wrong newlines in Git for Windows 2.24.1

Created on 12 Dec 2019  路  11Comments  路  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?
git version 2.24.1.windows.2
cpu: x86_64
built from commit: 992f0773022527b1b0cb1e0c13aec97dd5248053
sizeof-long: 4
sizeof-size_t: 8

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
Microsoft Windows [Version 10.0.18363.476]
(64-bit)
  • What options did you set as part of the installation? Or did you choose the
    defaults?
Editor Option: VIM # NOTE: I override this in my .bash_profile to be nano
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
Enable Builtin Interactive Add: 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

Bash


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

No errors to appear.

  • What actually happened instead?

The message [ Mistakes in '/usr/share/nano/git.nanorc' ] appears at the bottom of the nano screen. Upon exiting nano, the following is logged to the console:

Error in /usr/share/nano/git.nanorc on line 1: Regex strings must begin and end with a " character
" not understoodare/nano/git.nanorc on line 2: Command "
" not understoodare/nano/git.nanorc on line 10: Command "
" not understoodare/nano/git.nanorc on line 15: Command "
Error in /usr/share/nano/git.nanorc on line 19: Regex strings must begin and end with a " character
" not understoodare/nano/git.nanorc on line 20: Command "
" not understoodare/nano/git.nanorc on line 23: Command "
" not understoodare/nano/git.nanorc on line 26: Command "
" not understoodare/nano/git.nanorc on line 33: Command "
" not understoodare/nano/git.nanorc on line 36: Command "
" not understoodare/nano/git.nanorc on line 42: Command "
" not understoodare/nano/git.nanorc on line 44: Command "
" not understoodare/nano/git.nanorc on line 47: Command "
" not understoodare/nano/git.nanorc on line 50: Command "
" not understoodare/nano/git.nanorc on line 51: Command "
Error in /usr/share/nano/git.nanorc on line 53: Regex strings must begin and end with a " character
" not understoodare/nano/git.nanorc on line 54: Command "
" not understoodare/nano/git.nanorc on line 57: Command "
" not understoodare/nano/git.nanorc on line 60: Command "
" not understoodare/nano/git.nanorc on line 74: Command "
" not understoodare/nano/git.nanorc on line 77: Command "
" not understoodare/nano/git.nanorc on line 80: Command "

Upon inspecting the file, it appears it has Windows-style \r\n newlines instead of Unix-style \n newlines. Changing them fixes the issue.

Most helpful comment

@bigguiness
Run git bash with administrator privileges, and then run command
```
$ dos2unix /usr/share/nano/git.nanorc
````
I had the same issue and I didn't know dos2unix command.
So, your comment is so helpful for me!
Thank you!

All 11 comments

This is strange. My local /usr/share/nano/git.nanorc has the same issue. The git.nanorc in git-extra was last modified almost 2 years ago, but the Build agent updated the checksum in pkgbuild 13 days ago. @dscho could you check for an accidental local change that caused this checksum to change in 3638691 and updated the git.nanorc in the git-sdk repos, but not the git.nanorc in build-extra/git-extra?

@dscho could you check for an accidental local change that caused this checksum to change in 3638691 and updated the git.nanorc in the git-sdk repos, but not the git.nanorc in build-extra/git-extra?

Surely you did not mean https://github.com/git-for-windows/git/commit/3638691c64728bad2714a7d4908516997319c481, but instead https://github.com/git-for-windows/build-extra/commit/3638691?

I can suspect a reason: I switched to a new, more reliable (and most importantly: public) Azure Pipeline to build git-extra (and other MINGW packages): https://dev.azure.com/git-for-windows/git/_build?definitionId=32

Now, my guess is that the build-extra repository was cloned in https://dev.azure.com/git-for-windows/git/_build/results?buildId=46608 with the default core.autoCRLF=true.

And obviously I failed to inspect the resulting commits closely, and missed that change of checksums.

I pushed some commits that (hopefully) fix this and cross my fingers that https://dev.azure.com/git-for-windows/git/_build/results?buildId=47247 will work. Last time it took 11 minutes to build and publish git-extra... 馃

@ToadKing could I ask you to open a Git Bash as administrator in the meantime and convert the git.nanorc file to Unix line endings using dos2unix?

Surely you did not mean 3638691, but instead git-for-windows/build-extra@3638691?

yes. That's absolutely what I meant.

Yes, I've already converted the file and that fixes the issues for me.

Unfortunately, the Pipeline failed a couple of times, and one of my attempts to fix it broke the final run, _after_ the Pacman packages were published, so I had to fix things manually. The next snapshot should be fixed already.

I just merged a PR, which kicked of a snapshot build; Once that is complete, can I ask you to test with the new snapshot?

I've tried the snapshot installer Git-prerelease-2.24.1.windows.2.4.gb5deb24d74-64-bit.exe, nano was back in working order.

Git-prerelease-2.24.1.windows.2.4.gb5deb24d74-64-bit.exe fixes the issue for me as well.

I'm having the same issue.

How to you convert the git.nanorc file? I tried using dos2unix but get a Permission denied error.

Is the git.nanorc file the only one that has the problem?

@bigguiness
Run git bash with administrator privileges, and then run command
```
$ dos2unix /usr/share/nano/git.nanorc
````
I had the same issue and I didn't know dos2unix command.
So, your comment is so helpful for me!
Thank you!

@bigguiness alternatively, use the latest snapshot.

Was this page helpful?
0 / 5 - 0 ratings