Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LF line end is not handle correctly on Windows 10 #821

Closed
linrongbin16 opened this issue Jun 17, 2023 · 2 comments
Closed

LF line end is not handle correctly on Windows 10 #821

linrongbin16 opened this issue Jun 17, 2023 · 2 comments
Labels
duplicate This issue or pull request already exists windows Issue specific to the windows platform

Comments

@linrongbin16
Copy link

Description

I configured my git on Windows with $env:USERPROFILE\.gitconfig:

[user]
	name = linrongbin16
	email = linrongbin16@outlook.com
[safe]
	directory = *
[filter "lfs"]
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true
	clean = git-lfs clean -- %f
[core]
	fsmonitor = true
	untrackedcache = true

And I have a neovim plugin repository lsp-progress.nvim. The repository config lsp-progress.nvim/.git/config is:

[core]
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	ignorecase = true
[remote "origin"]
	url = git@github.com:linrongbin16/lsp-progress.nvim.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
	remote = origin
	merge = refs/heads/main
[lfs]
	repositoryformatversion = 0

Since I develop this plugin in both macOS and Windows, so the source code file is using LF, not the LFCR. So gitsigns will detect the whole file is changed (screenshot-1):

screenshot-1
image

But actually in github desktop, there's no changes (screenshot-2):
screenshot-2
image

Neovim version

NVIM v0.9.1 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe /MD /Zi /O2 /Ob1 -W3 -wd4311 -wd4146 -DUNIT_TESTING -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=0x0602 -DMSWIN -DINCLUDE_GENERATED_DECLARATIONS -ID:/a/neovim/neovim/.deps/usr/include/luajit-2.1 -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/build/src/nvim/auto -ID:/a/neovim/neovim/build/include -ID:/a/neovim/neovim/build/cmake.config -ID:/a/neovim/neovim/src -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include -ID:/a/neovim/neovim/.deps/usr/include system vimrc file: "$VIM\sysinit.vim" fall-back for $VIM: "C:/Program Files (x86)/nvim/share/nvim" Run :checkhealth for more info

Operating system and version

Windows 10 Enterprise 22H2 x86_64

Expected behavior

gitsigns detect LF correctly on Windows.

Actual behavior

gitsigns detect LF as changes.

Minimal config

for name, url in pairs{
  gitsigns = 'https://github.com/lewis6991/gitsigns.nvim',
  -- ADD OTHER PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE
} do
  local install_path = vim.fn.fnamemodify('gitsigns_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.opt.runtimepath:append(install_path)
end

require('gitsigns').setup{
  debug_mode = true, -- You must add this to enable debug messages
  -- ADD GITSIGNS CONFIG THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE
}

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. clone lsp-progress.nvim (or any project developed in macOS) to local directory: git clone https://github.com/linrongbin16/lsp-progress.nvim.
  2. open it with neovim (with gitsigns.nvim installed) and you will see.

Gitsigns debug messages

No response

@linrongbin16 linrongbin16 added the bug Something isn't working label Jun 17, 2023
@lewis6991
Copy link
Owner

Filter and smudge isn't supported. Duplicate of #480

@lewis6991 lewis6991 added duplicate This issue or pull request already exists windows Issue specific to the windows platform and removed bug Something isn't working labels Jun 17, 2023
@linrongbin16
Copy link
Author

close for duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists windows Issue specific to the windows platform
Projects
None yet
Development

No branches or pull requests

2 participants