vim-fugitive icon indicating copy to clipboard operation
vim-fugitive copied to clipboard

Git Commit Showing Empty COMMIT_EDITMSG

Open FatherOfEgg opened this issue 1 year ago • 3 comments

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

FatherOfEgg avatar May 05 '24 23:05 FatherOfEgg

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

andrewjhaman avatar May 31 '24 19:05 andrewjhaman

@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.

gotnone avatar Nov 21 '24 21:11 gotnone

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

tpope avatar Nov 21 '24 22:11 tpope

I'm also having this exact same error, in some computers it works and in others it doesn't, didn't seem to find anything else at the moment

Although it doesn't seems to be caused by any broken path as far as i can tell

Sofistico avatar Apr 08 '25 13:04 Sofistico

I have also have run into this issue. This definitely seems to be specific to Windows since I have never run into this on my macbook. I also have a feeling it has something to do with having cygwin tools installed -- at least for me.

Note the paths here. I may be mistaken, but typically when the cygwin tools are invoked you need to use the forward slash / as apposed to win/dos backslash \.

You can test this if you have the tools installed and run ls \cygwindrive\c\ throws a "No such file or directory". However, ls /cygwindrive/c/ works just fine.

Image

christopher-lawrence avatar Oct 14 '25 14:10 christopher-lawrence