-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Description:
The automatic commit message generation feature for the gitcommit extension does not work when initiating a commit with the fugitive.vim plugin.
The feature is configured to trigger automatically upon entering a gitcommit buffer. While the manual keymap (<leader>gc) works correctly inside the fugitive buffer, the auto_generate functionality fails to execute.
Steps to Reproduce:
- Configure the
gitcommitextension withauto_generate = true. - Install and enable the
tpope/vim-fugitiveplugin. - In a git repository with staged changes, run the Neovim command
:Git commit. - A
gitcommitbuffer is opened by fugitive.
Expected Behavior:
After the gitcommit buffer opens, the CodeCompanion extension should automatically generate a commit message and insert it into the buffer, according to the auto_generate setting.
Actual Behavior:
The gitcommit buffer opens, but no commit message is generated. The buffer remains empty, waiting for manual input. The user has to trigger the generation manually via the configured keymap.
Possible Cause:
The current implementation uses a FileType=gitcommit autocommand to register a nested WinEnter autocommand, which is responsible for triggering the generation logic. It is likely that fugitive's method of creating and presenting the commit window follows a different event sequence than other git tools.
The WinEnter event might not be firing as expected for the fugitive buffer, or it might be firing at a moment when the buffer is not yet fully configured, causing the conditions for generation to fail. This suggests that relying on WinEnter alone might not be robust enough to support various git plugin workflows. A more reliable event, or a combination of events, might be needed to reliably detect the readiness of the gitcommit buffer across different plugins.