-
Notifications
You must be signed in to change notification settings - Fork 4
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
Empy commit message being passed to git
#13
Comments
This sounds a bit strange, but I couldn’t reproduce it in my environment. Also, the BUFFER name is |
Ah yes, mine too. I didn't pay enough attention when writing this issue. Sounds like a me problem then. I could only make it work with some advising: (advice-add 'magit-gptcommit-commit-accept :after
(lambda ()
(when-let ((buf (magit-commit-message-buffer)))
(with-current-buffer buf
(save-buffer))))) I notice if I run the magitgpt-accept function again whilst in the COMMIT_EDITMSG buffer (so already after doing c then C from the I can reproduce with this slimline config: (require 'use-package)
(setq auth-sources '((:source "REDACTED")))
(use-package magit)
(use-package dash)
(use-package llm :custom (llm-warn-on-nonfree nil))
(use-package magit-gptcommit
:demand t
:after magit
:init
(require 'llm-openai)
:custom
(magit-gptcommit-llm-provider
(make-llm-openai
:key (auth-source-pick-first-password :host "api.openai.com" :user "REDACTED")
:chat-model "gpt-4o"))
:config
(magit-gptcommit-status-buffer-setup)
(magit-gptcommit-mode 1)) |
I've been using this package for quite a while, and around the same time this was posted, I started getting the same error message. |
I just found out about magit-gptcommit, tried it and was having the same issue. I noticed that the edit message buffer had to become dirty and then saved, to not have the "empty commit message" error. The |
Yeah, the advice add works for me as well when using |
Thanks for the neat package. I was looking for something just like this 👍🏻
I've just had a quick play (latest version) and I'm not sure if its PEBKAC or what, but despite a
COMMIT_MSG
buffer looking great, complete with generated content, a typical C-CC-c to commit in Magit is resulting in "Aborting commit due to empty commit message".This is regardless of the way I have generated the message using
magit-gptcommit
.If I override
magit-gptcommit-commit-accept
to add(save-buffer)
at the end then it works but that feels heavyweight and that it might mess up some other stuff. I naively tried things like(set-buffer-modified-p t)
instead but they didn't work.Again, feels like a me problem but if you have time I'd appreciate some pointers on what to look for.
The text was updated successfully, but these errors were encountered: