f-person / git-blame.nvim

Git Blame plugin for Neovim written in Lua
GNU General Public License v3.0
884 stars 43 forks source link

“Not Committed Yet” on all files when opening nvim from git #92

Closed robinmoussu closed 11 months ago

robinmoussu commented 1 year ago

When opening nvim using a custom git alias, git-blame.nvim displays “Not Committed Yet” on all lines.


How to reproduce:

You need to be in a git repository that contains a file some_file.txt. Add this in your ~/.config/git/config (or ~/.gitconfig, or ./.gitconfig, or …)

[alias]
custom_command = "sh -c \"nvim some_file.txt\" -"

Then run

git custom_command

It will start nvim with some_file.txt. On all lines of the file, you will have Not Committed Yet instead of the correct commit message.


It does work if I run the command directly : sh -c "nvim some_file.txt" -

OS: macOS Catalina 10.15.7 git version: 2.30.0 git-blame.nvim: 41e22dc (19th of August, current master) installed with lazy

bossley9 commented 11 months ago

Hey @robinmoussu can you try updating to the latest version and seeing if this issue still exists? I'm unable to reproduce this issue on the latest version. Also, side note that the command should technically have an exclamation/bang for external commands:

[alias]
custom_command = "!sh -c \"nvim some_file.txt\" -"
bossley9 commented 11 months ago

I am closing this issue due to inactivity. I can't reproduce this problem on the current version. If you still have an issue, please comment and we can reopen this issue

robinmoussu commented 9 months ago

Sorry, I forgot to check my github inbox. Indeed, it does seems to work. Thanks for the work you did in your plugin.