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
gitcommit extension with auto_generate = true.
- Install and enable the
tpope/vim-fugitive plugin.
- In a git repository with staged changes, run the Neovim command
:Git commit.
- A
gitcommit buffer 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.
Description:
The automatic commit message generation feature for the
gitcommitextension does not work when initiating a commit with thefugitive.vimplugin.The feature is configured to trigger automatically upon entering a
gitcommitbuffer. While the manual keymap (<leader>gc) works correctly inside the fugitive buffer, theauto_generatefunctionality fails to execute.Steps to Reproduce:
gitcommitextension withauto_generate = true.tpope/vim-fugitiveplugin.:Git commit.gitcommitbuffer is opened by fugitive.Expected Behavior:
After the
gitcommitbuffer opens, the CodeCompanion extension should automatically generate a commit message and insert it into the buffer, according to theauto_generatesetting.Actual Behavior:
The
gitcommitbuffer 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=gitcommitautocommand to register a nestedWinEnterautocommand, 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
WinEnterevent 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 onWinEnteralone 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 thegitcommitbuffer across different plugins.