Review, edit, and refine AI-generated commit messages with GitWhisper’s interactive confirmation workflow
GitWhisper’s interactive confirmation feature gives you complete control over your commit messages before they’re applied. Review, edit, retry with different models, or add custom context to get the perfect commit message.
When confirmation mode is enabled, GitWhisper presents you with the generated commit message and several options:
1
Review the Generated Message
GitWhisper displays the AI-generated commit message:
---------------------------------feat: add user authentication with JWT tokensImplement secure user authentication system using JWT tokensfor stateless session management. Add login and registrationendpoints with password hashing using bcrypt.---------------------------------What would you like to do with this commit message?> commit edit retry discard
2
Choose Your Action
Select from four options:
commit - Accept the message and create the commit
edit - Open your Git editor to modify the message
retry - Generate a new message (with options)
discard - Cancel the commit entirely
3
Create Your Commit
Once satisfied, select “commit” to apply the message and create your commit.
$ gw commit --confirmAnalyzing staged changes using openai (gpt-4o)...---------------------------------fix: update API endpointChange endpoint URL---------------------------------What would you like to do with this commit message?> editOpening editor...# You edit to:fix: update API endpoint URL to use HTTPSReplace HTTP endpoint with HTTPS for secure communicationwith the authentication service. Update all references inthe API client.---------------------------------fix: update API endpoint URL to use HTTPSReplace HTTP endpoint with HTTPS for secure communicationwith the authentication service. Update all references inthe API client.---------------------------------What would you like to do with this commit message?> commit✓ Commit created successfully
$ gw commit --confirm --model openaiAnalyzing staged changes using openai (gpt-4o)...---------------------------------refactor: optimize database queriesImprove query performance---------------------------------What would you like to do with this commit message?> retryHow would you like to retry?> different modelSelect a different model:> claudeRegenerating with claude...---------------------------------perf: optimize database queries with proper indexingAdd compound indexes on user_id and created_at columns toaccelerate the dashboard query. Reduces query time from 2.3sto 180ms in production dataset testing.---------------------------------What would you like to do with this commit message?> commit✓ Commit created successfully
$ gw commit -cAnalyzing staged changes using claude (claude-sonnet-4-5)...---------------------------------feat: add error handlingImplement error handling for API calls---------------------------------What would you like to do with this commit message?> retryHow would you like to retry?> add contextAdd context or instructions for the AI:> focus on the retry logic and exponential backoff implementationRegenerating with additional context...---------------------------------feat: implement robust error handling with exponential backoffAdd comprehensive error handling for API calls with exponentialbackoff retry strategy. Implements 3 retry attempts with delaysof 1s, 2s, and 4s before failing. Includes specific handling fornetwork timeouts, 429 rate limits, and 5xx server errors.---------------------------------What would you like to do with this commit message?> commit✓ Commit created successfully
Confirmation mode works seamlessly with multiple repositories:
$ gw commit --confirmWorking in 3 git repos[frontend] Review commit message:---------------------------------feat: add loading spinner component---------------------------------What would you like to do with this commit message?> commit✓ [frontend] Commit created successfully[backend] Review commit message:---------------------------------fix: resolve CORS policy issue---------------------------------What would you like to do with this commit message?> edit# ... edit and commit ...
Each repository is processed independently, allowing you to use different actions for each one.
The interactive confirmation workflow is implemented in commit_command.dart:650:
Future<String?> _handleCommitConfirmation({ required String commitMessage, required CommitGenerator generator, required String diff, // ... other parameters}) async { String currentMessage = commitMessage; while (true) { _logger ..info('\n---------------------------------\n') ..info(currentMessage) ..info('\n---------------------------------\n'); final action = _logger.chooseOne( 'What would you like to do with this commit message?', choices: ['commit', 'edit', 'retry', 'discard'], defaultValue: 'commit', ); switch (action) { case 'commit': return currentMessage; case 'edit': // Open Git editor for manual editing case 'retry': // Regenerate with same model, different model, or context case 'discard': return null; } }}