CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

hook not work

Open Chindada opened this issue 1 year ago • 2 comments

version: v0.14.2

To Reproduce

  1. git commit
  2. enter commit message edit vi
  3. enter :q

Describe the bug It will commit during the vi editor is showing, when i leaving vi, error occurs.

git commit
golangci-lint........................................(no files to check)Skipped
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: 589, CompletionTokens: 15, TotalTokens: 604
We are trying to summarize a title for pull request
PromptTokens: 196, CompletionTokens: 5, TotalTokens: 201
We are trying to get conventional commit prefix (Tools)
PromptTokens: 398, CompletionTokens: 5, TotalTokens: 403
================Commit Summary====================

build: improve system performance and stability

- Change Docker run command to use detached mode (`-d` flag)

==================================================
Write the commit message to .git/COMMIT_EDITMSG file
Git record changes to the repository
[develop dff0b2a] build: improve system performance and stability
 1 file changed, 1 insertion(+), 1 deletion(-)
fatal: cannot lock ref 'HEAD': is at dff0b2a88ce8089b4b24a61b1a4af5a31c8551f2 but expected b8e772c02c69640938447f6b2f8474ddb77fafcc
build: improve system performance and stability

- Change Docker run command to use detached mode (`-d` flag)

Signed-off-by: Tim Hsu@M2MAX-20230327 <[email protected]>
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
~                                                                                                                                             
"~/dev_projects/iom/mojave/.git/COMMIT_EDITMSG" 5L, 173B

Chindada avatar Jul 16 '24 16:07 Chindada

I will take it.

appleboy avatar Jul 21 '24 14:07 appleboy

I'm having this issue too. Currently I:

  1. Can only accept the commit message (no backing out with q!), and
  2. Can't modify the commit message due to an error like
fatal: cannot lock ref 'HEAD': is at 6555dec73f8f44a0230f1acb3dce034d3572d4fa but expected 4961b3359a9643d1321437d5b124d1607436df9c

alexander-turner avatar Aug 14 '24 05:08 alexander-turner

👍

longkey1 avatar Feb 09 '25 17:02 longkey1