tpope / vim-fugitive

fugitive.vim: A Git wrapper so awesome, it should be illegal
https://www.vim.org/scripts/script.php?script_id=2975
20.09k stars 1.01k forks source link

Git Commit Showing Empty COMMIT_EDITMSG #2299

Open FatherOfEgg opened 6 months ago

FatherOfEgg commented 6 months ago

cc / :Git commit worked in the past, but then for some reason it decided to not work. It does work if I do git commit while not in nvim, and it opens the COMMIT_EDITMSG properly in nvim.

I have the same nvim setup on another machine, and the commit works there.

https://github.com/tpope/vim-fugitive/assets/25647215/ac7f286a-91e1-4695-be9f-ddad577362dd

andrewjhaman commented 5 months ago

I am having the same issue. Reinstall of everything didn't seem to help

gotnone commented 2 days ago

@FatherOfEgg @andrewjhaman Can you check what the actual path of the COMMIT_EDITMSG file is on your broken system? I can't seem to see it in the video you provided.

I am having a similar issue, but with Msys2 bash as the shell. In my case the buffer that is spawned has a strange combination of the current working directory written as if it is a windows path and then a unix style path pointing to the COMMIT_EDITMSG location is appended to that working directory path.

E.g. for a git repository located at C:/src/test fugitive tries to edit the commit message at C:/src/test//c/src/test/.git/COMMIT_EDITMSG

The buffer that is spawned sometimes has the "relative" path displayed and sometimes this broken full path. To verify that the full path is broken I used the command :lua print(vim.fn.expand('%:p') )

I added some additional details on #31 which I thought may be more relevant because I am using msys2 and bash as my shell.

tpope commented 2 days ago

(I can't tell what's going on in that video because the progress bar is covering the bottom of the screen.)