appleboy / CodeGPT

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4o, gpt-4-turbo, gpt-3.5-turbo model) and automatically installs a git prepare-commit-msg hook.
MIT License
1.27k stars 110 forks source link

hook not work, it will stuck on `Commit preview summary? ▸Yes No` #188

Closed Chindada closed 4 months ago

Chindada commented 4 months ago

Version: version: 0.14.0 commit: 6f5ce01 OS: macOS 14.5

Steps to reproduce the behavior:

❯ git commit
lint.....................................................................^LPassed
format...................................................................Passed
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check that scripts with shebangs are executable..........................Passed
detect private key.......................................................Passed
Summarize the commit message use gpt-4o model
We are trying to summarize a git diff
PromptTokens: 14569, CompletionTokens: 185, TotalTokens: 14754
We are trying to summarize a title for pull request
PromptTokens: 367, CompletionTokens: 7, TotalTokens: 374
We are trying to get conventional commit prefix (Tools)
PromptTokens: 569, CompletionTokens: 5, TotalTokens: 574
================Commit Summary====================

feat: integrate custom workshop Kanban management

- Update dependencies in `package.json` to newer versions
- Add a new URL entry in `sitemap.xml` and update the `lastmod` date for existing URLs
- Create a new API module `kanban.ts` for managing workshop Kanban operations
- Add `cycleTime` prop to `KanbanMachine.vue` and display its value
- Add `count` prop to `KanbanMachineCount.vue` and display its value
- Add a new menu item for custom workshop Kanban in `AppMenu.vue`
- Add new localization keys for custom workshop Kanban in `tw.json` and `us.json`
- Add `faSlidersH` icon to the font-awesome library in `main.ts`
- Enhance `workshop/1.vue` with new Kanban API integration and WebSocket connection
- Create a custom workshop Kanban page `workshop/custom.vue` with CRUD operations

==================================================
Write the commit message to .git/COMMIT_EDITMSG file
Commit preview summary? ▸Yes  No
appleboy commented 4 months ago

@Chindada I will take it.

appleboy commented 4 months ago

@Chindada Try https://github.com/appleboy/CodeGPT/releases/tag/v0.14.1

Chindada commented 4 months ago

@appleboy I think there is extra issue in v0.14.1 (hook already reinstall by codegpt hook uninstall && codegpt hook install)

❯ git add .
❯ git commit
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check that scripts with shebangs are executable..........................Passed
detect private key.......................................................Passed
Summarize the commit message use gpt-4o model
We are trying to summarize a git diff
PromptTokens: 4516, CompletionTokens: 149, TotalTokens: 4665
We are trying to summarize a title for pull request
PromptTokens: 331, CompletionTokens: 7, TotalTokens: 338
We are trying to get conventional commit prefix (Tools)
PromptTokens: 533, CompletionTokens: 5, TotalTokens: 538
================Commit Summary====================

feat: add TimeRange message to protobuf definitions

- Add `TimeRange` message type to the protobuf definition in Golang
- Include `start` and `end` fields of `google.protobuf.Timestamp` type in the `TimeRange` message
- Modify the `file_analysis_analysis_proto_msgTypes` to include the new `TimeRange` message
- Update `file_analysis_analysis_proto_depIdxs` to reference the new fields in `TimeRange`
- Add `TimeRange` exporter function to the proto initialization
- Add `TimeRange` message definition to the protobuf file in `protos/v1/analysis/analysis.proto`
- Add `TimeRange` class to the TypeScript implementation, with `start` and `end` fields and methods for serialization and deserialization

==================================================
Write the commit message to .git/COMMIT_EDITMSG file
Git record changes to the repository
[main c3dd463] feat: add TimeRange message to protobuf definitions
 4 files changed, 194 insertions(+), 14 deletions(-)
fatal: cannot lock ref 'HEAD': is at c3dd463ac344a57ba4ee8af0b618602c25f7032a but expected 713a3e92362b5e0d46b64211abdea0655a5671b6

it will still show commit edit in vi editor but actualy, codegpt already commit after i enter :q git error happen