@@ -93,7 +93,7 @@ smart-git-commit --help
9393usage: smart-git-commit [-h] [--repo-path REPO_PATH] [--non-interactive]
9494 [--ollama-host OLLAMA_HOST]
9595 [--ollama-model OLLAMA_MODEL] [--no-ai]
96- [--timeout TIMEOUT]
96+ [--timeout TIMEOUT] [--verbose] [--skip-hooks]
9797
9898Smart Git Commit Workflow with Ollama Integration
9999
@@ -108,6 +108,8 @@ options:
108108 Model to use for Ollama (will prompt if not specified)
109109 --no-ai Disable AI-powered analysis
110110 --timeout TIMEOUT Timeout in seconds for HTTP requests (default: 10)
111+ --verbose Show verbose debug output
112+ --skip-hooks Skip Git hooks when committing (useful if pre-commit is not installed)
111113```
112114
113115## Example Commit
@@ -223,6 +225,31 @@ smart-git-commit --repo-path /path/to/your/repository
223225
224226### Common Issues
225227
228+ #### Error: "Not a git repository"
229+ - Ensure you're running the command from within a git repository
230+ - If needed, initialize a new git repository with ` git init `
231+ - Verify that the ` .git ` directory exists and is accessible
232+
233+ #### Error: "Repository path does not exist"
234+ - Check that the specified path exists when using ` --repo-path `
235+ - Use absolute paths if relative paths aren't working correctly
236+
237+ #### Error: "Git is not properly configured"
238+ - Git requires user.name and user.email to be set before committing
239+ - Configure with:
240+ ``` bash
241+ git config --global user.name " Your Name"
242+ git config --global user.email " your.email@example.com"
243+ ```
244+
245+ #### Error: "Failed to stage files"
246+ - When running from a subdirectory, use the ` --repo-path ` argument to specify the git root directory:
247+ ``` bash
248+ # If you're in a subdirectory like 'backend'
249+ smart-git-commit --repo-path ..
250+ ```
251+ - Ensure you have write access to the repository files
252+
226253#### Error: "No models found in Ollama"
227254- Make sure Ollama is running: ` ollama serve `
228255- Check that you have at least one model installed: ` ollama list `
@@ -247,6 +274,23 @@ smart-git-commit --repo-path /path/to/your/repository
247274 ```
248275- For slow networks or large models, a longer timeout may be necessary
249276
277+ #### Error: "No module named pre_commit"
278+ - This occurs when your repository has pre-commit hooks configured but the pre-commit Python module is not installed
279+ - Solutions:
280+ 1 . Install pre-commit: ` pip install pre-commit `
281+ 2 . Skip the hooks: ` smart-git-commit --skip-hooks `
282+ 3 . Remove pre-commit hooks from the repository if not needed
283+
284+ ### Command-Line Debugging
285+
286+ For more detailed information when errors occur, use the ` --verbose ` flag:
287+
288+ ``` bash
289+ smart-git-commit --verbose
290+ ```
291+
292+ This will show additional debugging information that can help diagnose issues.
293+
250294### Ollama Connection Issues
251295
252296If you encounter issues connecting to Ollama:
326370
327371# Changelog
328372
373+ ## 0.1.6 (2025-04-27)
374+ - Improved error handling for git repositories and file paths
375+ - Added detection and proper handling when running from subdirectories
376+ - Added clear, user-friendly error messages with actionable instructions
377+ - Added --verbose flag for detailed debugging information
378+ - Added verification of git configuration before committing
379+ - Added checks to prevent incomplete staging and failed commits
380+ - Added detection and handling of pre-commit hooks with --skip-hooks option
381+ - Added automatic fixes for "No module named pre_commit" errors
382+ - Expanded troubleshooting documentation with common error solutions
383+ - Added relative path resolution to prevent path duplication issues
384+
329385## 0.1.5 (2025-04-26)
330386- Fixed issue with file paths when running from subdirectories
331387- Fixed commit message file path handling in git repositories
0 commit comments