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

:Gitsigns blame "Show commit" on same commit hash causes error #1121

Closed
YodaEmbedding opened this issue Sep 17, 2024 · 5 comments · Fixed by #1136
Closed

:Gitsigns blame "Show commit" on same commit hash causes error #1121

YodaEmbedding opened this issue Sep 17, 2024 · 5 comments · Fixed by #1136
Labels
bug Something isn't working

Comments

@YodaEmbedding
Copy link

Description

Running "Show commit" on the same hash causes error.

Neovim version

v0.10.1

Operating system and version

macOS 14.6.1

Expected behavior

Show commit.

Actual behavior

Results in error:

Error executing vim.schedule lua callback: ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:95: The async coroutine failed: ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/blame.lua:194: Failed to rename buffer
stack traceback:
        [C]: in function 'nvim_buf_set_name'
        ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/blame.lua:194: in function <...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/blame.lua:188>
stack traceback:
        [C]: in function 'error'
        ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:95: in function 'cb'
        ...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:145: in function <...cal/share/nvim/lazy/gitsigns.nvim/lua/gitsigns/async.lua:144>

Minimal config

-- Can be provided if maintainer cannot reproduce.

Steps to reproduce

  1. :Gitsigns blame
  2. s to "Show commit"
  3. Close window (C-w c)
  4. s to "Show commit"

Gitsigns debug messages

No response

Gitsigns cache

No response

@YodaEmbedding YodaEmbedding added the bug Something isn't working label Sep 17, 2024
@mikehaertl
Copy link

I see a similar error on random occasions when I blame from a buffer (so not on a commit or something like OP).

Before I create another issue I'd like to verify that it's really a different problem. My error also includes async.lua:95 like above.

Here's my error message:

Error executing Lua callback: .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:95: The async coroutine failed: .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:95: The async coroutine faile
d: .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/blame.lua:104: Invalid 'replacement string' item: expected String, got nil
stack traceback:
        [C]: in function 'nvim_buf_set_lines'
        .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/blame.lua:104: in function 'render'
        .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/blame.lua:276: in function <.../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/blame.lua:253>
stack traceback:
        [C]: in function 'error'
        .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:95: in function 'step'
        .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:130: in function 'f'
        ...al/share/nvim/plugged/gitsigns.nvim/lua/gitsigns/cli.lua:96: in function <...al/share/nvim/plugged/gitsigns.nvim/lua/gitsigns/cli.lua:61>
stack traceback:
        [C]: in function 'error'
        .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:95: in function 'step'
        .../share/nvim/plugged/gitsigns.nvim/lua/gitsigns/async.lua:130: in function 'run'
        ....local/share/nvim/plugged/gitsigns.nvim/lua/gitsigns.lua:119: in function <....local/share/nvim/plugged/gitsigns.nvim/lua/gitsigns.lua:118>

@al-eax
Copy link

al-eax commented Oct 1, 2024

I got the same error on windows. Same happens when trying to open the Commit with in a new tab S.
When pressing Enter in the history log before pressing s or S, nothing happens

@spaceman1412

This comment has been minimized.

@antoinemadec
Copy link
Contributor

@YodaEmbedding @mikehaertl @al-eax @spaceman1412 this is fixed in #1136

Could you please try it on your end and confirm it fixes your issues?

@al-eax
Copy link

al-eax commented Oct 21, 2024

@antoinemadec thank you so much.
I can confirm: the issue is fixed on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants