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

Handle new output from git blame command when using --contents #84

Closed gunslingerfry closed 1 year ago

gunslingerfry commented 1 year ago

Starting with git 2.4.1, using --contents git outputs "External file (--contents)" instead of "Not committed yet." This is an extremely bizarre decision because the command doesn't know the current state of the file on disk and therefore it cannot differentiate between changes that are truly 'not committed yet' and ones that are just in the temporary buffer passed in.

This breaks all 'real time' git blame plugins like git-blame.nvim. git-blame.nvim should mitigate this change by replacing the output "External file (--contents)" with the previous message "Not committed yet." Additionally, git-blame will output a spurious date and commit message and should not be output. See attached image.

20230624_14h33m41s_grim

Here is the commit of limited usefulness from git: https://github.com/git/git/commit/603d0fdce2ca84d4dc7b26e46430778fe9c4cb72

f-person commented 1 year ago

Thanks for letting me know!