On work, we are using an editorconfig with the following content:
[*]
charset = utf-8-bom
end_of_line = crlf
as we have a lot of developers using windows.
However, I am using macOS, and I am having some issues with gitsigns marking every line as changed. Maybe I am doing something wrong.
I tried to set core.autocrlf to different values, and none of them seems to change anything.
Neovim version
NVIM v0.11.0-dev-283+gfe5d1279a
Operating system and version
macOS 14.5 (23F79)
Expected behavior
I would expect it to not show any changes, as I haven't done any changes to the file.
Actual behavior
It shows that all lines are changed like this:
Also, trying to view the diff in a popup with :Gitsigns preview_hunk, this happens:
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
Create a file with some content with LF line endings. Doesn't matter.
Paste this into a .editorconfig:
[*]
charset = utf-8-bom
end_of_line = crlf
Open the file again and notice it shows all lines as diffed.
Gitsigns debug messages
22.87 D attach(1): Attaching (trigger=BufReadPost)
23.00 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 config user.name
44.16 D run_job: git --version
56.32 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 rev-parse --show-toplevel --absolute-git-dir --abbrev-ref HEAD
67.76 D run_job: git --no-pager --no-optional-locks --literal-pathspecs -c gc.auto=0 --git-dir /Users/sebastian/bom-test/.git -c core.quotepath=off ls-files --stage --others --exclude-stan
dard --eol /Users/sebastian/bom-test/foo.lua
81.29 D watch_gitdir(1): Watching git dir
(Also a lot of deriving colors which doesn't seem relevant)
Description
On work, we are using an editorconfig with the following content:
as we have a lot of developers using windows.
However, I am using macOS, and I am having some issues with gitsigns marking every line as changed. Maybe I am doing something wrong.
I tried to set
core.autocrlf
to different values, and none of them seems to change anything.Neovim version
NVIM v0.11.0-dev-283+gfe5d1279a
Operating system and version
macOS 14.5 (23F79)
Expected behavior
I would expect it to not show any changes, as I haven't done any changes to the file.
Actual behavior
It shows that all lines are changed like this:![image](https://github.com/lewis6991/gitsigns.nvim/assets/5160701/88eecb71-e0e8-434a-be8b-b85be6ac6ff5)
Also, trying to view the diff in a popup with![image](https://github.com/lewis6991/gitsigns.nvim/assets/5160701/23a3b011-c1d8-40e5-b34d-88ffcf091d59)
:Gitsigns preview_hunk
, this happens:Minimal config
Steps to reproduce
Create a file with some content with LF line endings. Doesn't matter.
Paste this into a .editorconfig:
Open the file again and notice it shows all lines as diffed.
Gitsigns debug messages
(Also a lot of deriving colors which doesn't seem relevant)