Giter Site home page Giter Site logo

Comments (8)

PhilippFeO avatar PhilippFeO commented on June 12, 2024 2

Removing

yadm = { 
 enable = false
}

solves the issue. I found it by trial and error. An error message indicating a solution or a more verbose commit message would have improved removing the error message. The help on yadm pointing to gitsigns-config-on_attach_pre but this term doesn't show up in the help at all.

To be honest, I don't know what yadm is about. I use(d) kickstart.nvim and should not have touched gitsigns. Maybe it is completely obvious for people who know yadm.

from gitsigns.nvim.

DrKJeff16 avatar DrKJeff16 commented on June 12, 2024 1

Welp, a bit of an awkward oversight from my part. Either way, thanks for your time, and apologies for taking it up.

from gitsigns.nvim.

lewis6991 avatar lewis6991 commented on June 12, 2024

If you don't use yadm, then why on earth did you configure it in gitsigns?

I strongly suggest you remove any configuration that repeats the defaults since you'll see this issue again. The more config you have, the more likely you are to have issues when config changes.

from gitsigns.nvim.

PhilippFeO avatar PhilippFeO commented on June 12, 2024

I use(d) it, because it was part of kickstart.nvim. For me, the point of kickstart.nvim is that I don't have to iterate over every plugin before using it – very handy when starting with Neovim.

from gitsigns.nvim.

lewis6991 avatar lewis6991 commented on June 12, 2024

kickstart.nvim should not be setting fields which are already default.

EDIT: not on master https://github.com/nvim-lua/kickstart.nvim/blob/19afab164183a5e80d8f7e7ae9df6b57e26a4a48/init.lua#L243-L259

from gitsigns.nvim.

PhilippFeO avatar PhilippFeO commented on June 12, 2024

Can't comment on that. It was nearly a year ago that I started using Neovim.

Anyway, does this all even matter? Before we continue another pointless discussion on the internet, I propose I close the issue and we are both happy that everything works. I, because I fixed it myself and you, because you had no work fixing anything. When you agree on that, you can also close the issue.

from gitsigns.nvim.

DrKJeff16 avatar DrKJeff16 commented on June 12, 2024

It's Back (6ef8c54)

I have debugged all my config after followed your instructions regarding yadm, yet the warning keeps popping up:

Screenshot_20240404_124759_Termux.png

This only appeared after updating. At first I thought it was an error concerning a fault in my code (there was, but it was unrelated). After debugging and fixing it, the same warning has kept popping up thus far.

I'll provide a sample of my configuration, but bear in mind I'm using customized modules for handling some stuff. Still, I've documented all the bits I've deemed relevant. If anything else is needed from my config please tell me.

--- ...
local Gsig = require('gitsigns')

---@type UserBufModeKeys
local keys = {
	n = {
		-- Navigati7on
		{ lhs = '<leader>G]c', rhs = "&diff ? ']c' : '<CMD>Gitsigns next_hunk<CR>'", opts = { expr = true } },
		{ lhs = '<leader>G[c', rhs = "&diff ? '[c' : '<CMD>Gitsigns prev_hunk<CR>'", opts = { expr = true } },

		-- Actions
		{ lhs = '<leader>Ghs', rhs = ':Gitsigns stage_hunk<CR>' },
		{ lhs = '<leader>Ghr', rhs = ':Gitsigns reset_hunk<CR>' },
		{ lhs = '<leader>GhS', rhs = '<CMD>Gitsigns stage_buffer<CR>' },
		{ lhs = '<leader>Ghu', rhs = '<CMD>Gitsigns undo_stage_hunk<CR>' },
		{ lhs = '<leader>GhR', rhs = '<CMD>Gitsigns reset_buffer<CR>' },
		{ lhs = '<leader>Ghp', rhs = '<CMD>Gitsigns preview_hunk<CR>' },
		{ lhs = '<leader>Ghb', rhs = '<CMD>lua require"gitsigns".blame_line{full=true}<CR>' },
		{ lhs = '<leader>Gtb', rhs = '<CMD>Gitsigns toggle_current_line_blame<CR>' },
		{ lhs = '<leader>Ghd', rhs = '<CMD>Gitsigns diffthis<CR>' },
		{ lhs = '<leader>GhD', rhs = '<CMD>lua require"gitsigns".diffthis("~")<CR>' },
		{ lhs = '<leader>Gtd', rhs = '<CMD>Gitsigns toggle_deleted<CR>' },
	},
	v = {
		{ lhs = '<leader>Ghs', rhs = ':Gitsigns stage_hunk<CR>' },
		{ lhs = '<leader>Ghr', rhs = ':Gitsigns reset_hunk<CR>' },
	},
}

---@alias GitSignOpts { ['text']: string }

---@class GitSigns
---@field add GitSignOpts
---@field change GitSignOpts
---@field delete GitSignOpts
---@field topdelete GitSignOpts
---@field changedelete GitSignOpts
---@field untracked GitSignOpts

---@alias GitSignsArr GitSigns[]

---@type GitSigns
local signs = {
	add          = { text = '÷' },
	change       = { text = '~' },
	delete       = { text = '-' },
	topdelete    = { text = 'X' },
	changedelete = { text = '' },
	untracked    = { text = '' },
}

Gsig.setup({
	---@param bufnr integer
	on_attach = function(bufnr)
		for mode, v in next, keys do
			---@type BufMapFunction
			local func = bufmap[mode]

			for _, t in next, v do
				func(bufnr, t.lhs, t.rhs, t.opts or {})
			end
		end
	end,

	signs = signs,

	signcolumn = true,  -- Toggle with `:Gitsigns toggle_signs`
	numhl      = true, -- Toggle with `:Gitsigns toggle_numhl`
	linehl     = false, -- Toggle with `:Gitsigns toggle_linehl`
	word_diff  = false, -- Toggle with `:Gitsigns toggle_word_diff`
	watch_gitdir = { follow_files = true },
	auto_attach = true,
	attach_to_untracked = true,
	current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
	current_line_blame_opts = {
		virt_text = false,
		virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
		delay = 5000,
		ignore_whitespace = false,
		virt_text_priority = 100,
	},
	current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
	sign_priority = 4,
	update_debounce = 100,
	-- status_formatter = nil, -- Use default
	max_file_length = 40000, -- Disable if file is longer than this (in lines)
	preview_config = {
		border = 'double',
		style = 'minimal',
		relative = 'cursor',
		row = 0,
		col = 1,
	},

	-- WARN: This causes a VERY annoying warning
	--		 each time Neovim starts.
	--		 See: [https://github.com/lewis6991/gitsigns.nvim/issues/965](this issue).
	-- yadm = { enable = false },
})
--- ...

from gitsigns.nvim.

lewis6991 avatar lewis6991 commented on June 12, 2024

You know the commit you referenced is 4 months old?

from gitsigns.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.