@@ -29,8 +29,8 @@ to generate meaningful git commit messages following the Conventional Commits
2929specification. It integrates seamlessly with CodeCompanion's LLM adapters to
3030analyze your staged changes and create appropriate commit messages.
3131
32- Version 2.0 introduces comprehensive Git operations through the @git_bot tool,
33- providing a natural language interface for Git workflow management within
32+ The extension provides comprehensive Git operations through the @git_bot tool,
33+ offering a natural language interface for Git workflow management within
3434CodeCompanion chat buffers.
3535
3636==============================================================================
@@ -47,7 +47,7 @@ CodeCompanion chat buffers.
4747• Support for both regular commits and `git commit --amend`
4848• File filtering support with glob patterns to exclude files from analysis
4949
50- ### Git Tool Features (🆕 v2.0)
50+ ### Git Tool Features
5151• @git_bot tool - Advanced Git operations through CodeCompanion chat
5252• Git status and branch management - Check status, create/switch branches
5353• Advanced Git operations - Diff, log, blame, stash operations
@@ -73,6 +73,7 @@ Add this extension to your CodeCompanion configuration:
7373 exclude_files = { "*.pb.go", "*.min.js", "package-lock.json" }, -- Optional: exclude files from diff analysis
7474 add_git_tool = true, -- Optional: add @git_bot tool to CodeCompanion (default: true)
7575 add_git_commands = true, -- Optional: add :CodeCompanionGit commands (default: true)
76+ gitcommit_select_count = 100, -- Optional: number of recent commits for /gitcommit slash command (default: 100)
7677 buffer = {
7778 enabled = true, -- Enable gitcommit buffer keymaps
7879 keymap = "<leader> gc", -- Keymap for generating commit message
@@ -94,12 +95,13 @@ opts = {
9495 add_slash_command = false, -- Add /gitcommit slash command to chat buffer
9596 adapter = "openai", -- LLM adapter to use (optional)
9697 model = "gpt-4", -- Model to use (optional)
97- languages = { "English", "简体中文 ", "日本語 " }, -- Languages for commit messages (optional)
98+ languages = { "English", "Chinese ", "Japanese " }, -- Languages for commit messages (optional)
9899 exclude_files = { "*.pb.go", "*.min.js", "package-lock.json" }, -- File patterns to exclude from diff analysis (optional)
99100 add_git_tool = true, -- Add @git_bot tool to CodeCompanion (default: true)
100101 add_git_commands = true, -- Add :CodeCompanionGit commands (default: true)
101102 git_tool_auto_submit_errors = false, -- Auto-submit git tool errors to LLM (default: false)
102103 git_tool_auto_submit_success = false, -- Auto-submit git tool success to LLM (default: false)
104+ gitcommit_select_count = 100, -- Number of recent commits to show in /gitcommit slash command (default: 100)
103105 buffer = {
104106 enabled = true, -- Enable gitcommit buffer keymaps
105107 keymap = "<leader> gc", -- Keymap for generating commit message
@@ -137,7 +139,7 @@ languages *gitcommit-languages*
137139 before generating the commit message. If not provided or empty,
138140 commit messages will be generated in English by default.
139141
140- Example: { "English", "简体中文 ", "日本語 ", "Français " }
142+ Example: { "English", "Chinese ", "Japanese ", "French " }
141143
142144exclude_files *gitcommit-exclude-files*
143145 Type: table
@@ -176,6 +178,13 @@ git_tool_auto_submit_success *gitcommit-git-tool-auto-submit-success*
176178 When enabled, automatically submits git tool success messages back to
177179 the LLM to continue the workflow.
178180
181+ gitcommit_select_count *gitcommit-gitcommit-select-count*
182+ Type: number
183+ Default: 100
184+ Number of recent commits to show when using the /gitcommit slash command.
185+ This controls how many commits are available for selection in the
186+ interactive commit selector.
187+
179188buffer.enabled *gitcommit-buffer-enabled*
180189 Type: boolean
181190 Default: true
@@ -216,8 +225,8 @@ Use the provided commands to generate commit messages:
216225• | :CCGitCommit | - Short alias for the above command
217226
218227Use the provided commands for git operations:
219- • | :CodeCompanionGit | - Open CodeCompanion chat with git assistant (🆕)
220- • | :CCGit | - Short alias for git assistant (🆕)
228+ • | :CodeCompanionGit | - Open CodeCompanion chat with git assistant
229+ • | :CCGit | - Short alias for git assistant
221230
2222315.2 GitCommit Buffer Integration *codecompanion-gitcommit-buffer*
223232
@@ -349,7 +358,7 @@ language commands within CodeCompanion chat buffers.
3493587.1 Interactive Git Assistant *codecompanion-gitcommit-git-assistant*
350359
351360Use | :CodeCompanionGit | or | :CCGit | to open a CodeCompanion chat buffer with
352- the `@g it_bot` tool pre-loaded. This gives you a natural language interface
361+ the `@g it_bot` tool pre-loaded. This provides a natural language interface
353362to Git operations.
354363
3553647.2 Chat Integration *codecompanion-gitcommit-chat-integration*
@@ -399,6 +408,13 @@ Stash Operations~
399408Advanced Operations~ (require approval)
400409• `@git_bot reset --commit_hash HASH [--mode soft| mixed | hard]` - Reset to commit
401410
411+ GitIgnore Management~
412+ • `@git_bot gitignore_get` - View current .gitignore content
413+ • `@git_bot gitignore_add --gitignore_rule "RULE"` - Add rule to .gitignore
414+ • `@git_bot gitignore_add --gitignore_rules ["rule1", "rule2"]` - Add multiple rules
415+ • `@git_bot gitignore_remove --gitignore_rule "RULE"` - Remove rule from .gitignore
416+ • `@git_bot gitignore_check --gitignore_file "FILE"` - Check if file is ignored
417+
4024187.4 Safety Features *codecompanion-gitcommit-safety*
403419
404420The git tool includes automatic safety features:
@@ -432,6 +448,15 @@ Investigation Workflow:~
432448 @git_bot blame --file_path src/main.lua --line_start 50 --line_end 60
433449<
434450
451+ GitIgnore Management Workflow:~
452+ >
453+ @git_bot gitignore_get # View current .gitignore
454+ @git_bot gitignore_add --gitignore_rule "*.log" # Add single rule
455+ @git_bot gitignore_add --gitignore_rules ["dist/", "build/", "*.tmp"] # Add multiple rules
456+ @git_bot gitignore_check --gitignore_file "temp.log" # Check if file is ignored
457+ @git_bot gitignore_remove --gitignore_rule "*.log" # Remove rule
458+ <
459+
435460==============================================================================
4364618. API *codecompanion-gitcommit-api*
437462
@@ -451,7 +476,7 @@ gitcommit.generate({lang}, {callback}) *gitcommit.generate()*
451476 local gitcommit = require("codecompanion").extensions.gitcommit
452477
453478 -- Generate with specific language
454- gitcommit.generate("简体中文 ", function(result, error)
479+ gitcommit.generate("Chinese ", function(result, error)
455480 if error then
456481 print("Error:", error)
457482 else
@@ -496,7 +521,7 @@ gitcommit.get_buffer_config() *gitcommit.get_buffer_config()*
496521 Returns:~
497522 table: Configuration table with buffer settings
498523
499- Git Tool API (🆕) *gitcommit.git_tool_api()*
524+ Git Tool API *gitcommit.git_tool_api()*
500525 Access to git tool functions for programmatic usage.
501526
502527gitcommit.git_tool.status() *gitcommit.git_tool.status()*
@@ -584,7 +609,7 @@ lua/codecompanion/_extensions/gitcommit/
584609├── buffer.lua # GitCommit buffer keymap integration
585610├── langs.lua # Language selection functionality
586611├── types.lua # Type definitions and TypeScript-style annotations
587- └── tools/ # Git tool implementations (🆕)
612+ └── tools/ # Git tool implementations
588613 ├── git.lua # Core git operations and command execution
589614 └── git_bot.lua # CodeCompanion chat tool integration
590615
@@ -626,15 +651,15 @@ init.lua~
626651 extension exports for programmatic usage. Also manages git tool
627652 integration and command setup.
628653
629- tools/git.lua~ (🆕)
654+ tools/git.lua~
630655 Core git operations engine providing safe git command execution with
631656 error handling, repository validation and detection, git status, log,
632657 diff, and branch operations, file staging/unstaging and blame information,
633658 stash management and commit operations, branch creation, checkout, and
634659 management, repository insights (contributors, remotes, commit search),
635660 and reset operations with safety checks.
636661
637- tools/git_bot.lua~ (🆕)
662+ tools/git_bot.lua~
638663 CodeCompanion chat tool integration providing OpenAI-compatible function
639664 calling schema, natural language interface for git operations, comprehensive
640665 parameter validation and handling, formatted output for chat buffer display,
0 commit comments