Skip to content

fix (#1319): gitsigns deprecated functions#1321

Merged
feoh merged 1 commit into
nvim-lua:masterfrom
ErlanRG:fix-gitsigns
Feb 15, 2025
Merged

fix (#1319): gitsigns deprecated functions#1321
feoh merged 1 commit into
nvim-lua:masterfrom
ErlanRG:fix-gitsigns

Conversation

@ErlanRG

@ErlanRG ErlanRG commented Jan 21, 2025

Copy link
Copy Markdown
Contributor
  • This commit change two functions that are marked as deprecated now: gitsigns.stage_hunk and gitsigns.toggle_deleted

- This commit change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`
@feoh

feoh commented Feb 15, 2025

Copy link
Copy Markdown
Collaborator

My minimal testing saw no problems. Thanks for the contribution! Merging.

@feoh feoh merged commit 94f551b into nvim-lua:master Feb 15, 2025
dribic pushed a commit to dribic/nvim-files that referenced this pull request Feb 15, 2025
- This commit change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`

Signed-off-by: Dejan Ribič <dejan.ribic@gmail.com>
nikhil-vemula pushed a commit to nikhil-vemula/kickstart.nvim that referenced this pull request Feb 16, 2025
- This commit change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`
faizfrhn added a commit to faizfrhn/kickstart.nvim that referenced this pull request Feb 16, 2025
* fix (nvim-lua#1319): gitsigns deprecated functions (nvim-lua#1321)
* change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`
@b4shful

b4shful commented Feb 17, 2025

Copy link
Copy Markdown

@ErlanRG @feoh
Can you take a closer look at this and see if it's definitely correct? Particularly the desc parameters.

--- a/lua/kickstart/plugins/gitsigns.lua
+++ b/lua/kickstart/plugins/gitsigns.lua
@@ -44,7 +44,7 @@
-        map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
+        map('n', '<leader>hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })

You have changed undo_stage_hunk to stage_hunk, should the description be changed too?

Actually looking into it a bit, I think stage hunk is already mapped, so perhaps if it undoes/redoes using the same function, we could just have one keybind for this? Something like "git stage/unstage hunk".

@@ -54,7 +54,7 @@
-        map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
+        map('n', '<leader>tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })

You have changed toggle_deleted to preview_hunk_inline. I'm not sure if this is supposed to be a functional replacement, or just replacing it with a new mapping due to the old command being deprecated.

But either way, unless preview_hunk_inline happens to toggle show deleted, then the description should really be changed too.

@dam9000

dam9000 commented Feb 17, 2025

Copy link
Copy Markdown
Contributor

@b4shful I agree this does not seem to be a completely correct change, perhaps it would be worth checking if the obsoleted functions have an actual replacement, or if this functionality should be removed all together.

@feoh

feoh commented Feb 18, 2025

Copy link
Copy Markdown
Collaborator

Thanks I guess I merged too quickly.

Would anyone be willing to spin up a new PR fixing the desc problems you see?

ditatompel added a commit to ditatompel/ditatompel that referenced this pull request Feb 19, 2025
This commit change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`.

See: nvim-lua/kickstart.nvim#1321

Co-authored-by: Erlan Rangel <32745670+ErlanRG@users.noreply.github.com>
petalas pushed a commit to petalas/nvim that referenced this pull request Feb 19, 2025
- This commit change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`
petalas pushed a commit to petalas/nvim that referenced this pull request Feb 19, 2025
- This commit change two functions that are marked as deprecated now:
`gitsigns.stage_hunk` and `gitsigns.toggle_deleted`
@b4shful

b4shful commented Feb 27, 2025

Copy link
Copy Markdown

Thanks I guess I merged too quickly.

Would anyone be willing to spin up a new PR fixing the desc problems you

Lots going on at university right now, haven't had time to do anything unfortunately. Hence the request below which otherwise I would do myself.

Could somebody spin this out into an issue so that it doesn't get lost in here as comments on a PR?

(yes, I did just open an issue on something unrelated, but I haven't opened one for this because I don't actually use gitsigns and would have to research the plugin and what the different functions are supposed to do before I knew what to even write haha)

@moustario moustario mentioned this pull request Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants