Commit 2b4afbe
authored
feat(gitcommit): improve diff filtering and notification flow (#7)
* feat(gitcommit): improve diff filtering and notification flow
- add tracking of all and excluded files in diff filtering
- return original diff if all files are excluded
- move commit message notification to after language selection
- trim whitespace in contextual diff checks for accuracy
- enable auto submit on git tool success in config
- refactor generate_commit_message for clearer notification order
* feat(git-tool): 丰富所有工具函数的返回值,增加 user_msg 和 llm_msg 字段
- 为 status、log、diff、branch、remotes、show、blame、stash_list、diff_commits、contributors、search_commits、tags 等函数增加 user_msg 和 llm_msg 字段
- 便于工具链和 LLM 处理更丰富的上下文信息
- 保持原有接口兼容
* fix(gitcommit): improve .gitignore and git read tool error handling
- 增强 .gitignore 相关函数的错误提示和返回结构
- git_read 工具输出增加 user_msg/llm_msg,提升交互体验
- 修复部分判断和消息提示逻辑
* feat(git): improve error handling and robustness in git tools
- wrap all git operations in pcall for safer execution
- ensure consistent error messages and output formatting
- enhance commit, stage, unstage, and read tool reliability
- update user and LLM messages for clearer feedback
- refactor contextual diff and commit logic for edge cases
- add utility trim function and remove redundant code
* fix(gitcommit): 优化参数校验与响应格式
- 增加参数校验辅助函数,提升健壮性
- 统一各工具响应格式,便于维护和扩展
- 修复部分注释与边界条件判断
- 优化错误处理,确保一致性
* fix(generator): improve LLM response handling logic
- restructure response processing for clarity
- handle error status with specific error messages
- ensure callback is called for all response cases
- add missing handler comment for LLM response1 parent b95cf5b commit 2b4afbe
File tree
8 files changed
+595
-377
lines changed- lua/codecompanion/_extensions/gitcommit
- tools
8 files changed
+595
-377
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
| |||
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
0 commit comments