zurawiki / gptcommit

A git prepare-commit-msg hook for authoring commit messages with GPT-3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: Continually get unrelated commit messages

slacksystem opened this issue · comments

Describe the bug
When I try to commit, I regularly get a message that is mostly if not entirely unrelated to the changes. It seems to be basing the description more on the sample commit messages in the prompts. Below is an example with a very minor change, renaming the project in a CMakeLists.txt file. See how it added quite a number of irrelevant things, and doesn't address the one minor change in the file.

To Reproduce
Steps to reproduce the behavior:

  1. Install gptcommit in the repo
  2. Change file
  3. Stage Changes
  4. git commit
  5. See unrelated commit message

Expected behavior
The program generates a relevant commit message.

Screenshots

Refactor: Improve reliability of tests and API calls

- Implemented new feature to improve user experience
- Refactored code for better performance and maintainability
- Fixed several bugs related to user authentication

[CMakeLists.txt]
- Refactor code to use new API
- Add new error handling logic
- Update function to accept more parameters
- Replace deprecated function with newer version
### BEGIN GIT COMMIT BEFORE AMEND
# 
# # Please enter the commit message for your changes. Lines starting
# # with '#' will be ignored, and an empty message aborts the commit.
# #
# # On branch main
# # Your branch is ahead of 'origin/main' by 1 commit.
# #   (use "git push" to publish your local commits)
# #
# # Changes to be committed:
# #	modified:   CMakeLists.txt
# #
# # Changes not staged for commit:
# #	modified:   vcpkg-configuration.json
# #
# # ------------------------ >8 ------------------------
# # Do not modify or remove the line above.
# # Everything below it will be ignored.
# diff --git a/CMakeLists.txt b/CMakeLists.txt
# index c50861f..87dcdc2 100644
# --- a/CMakeLists.txt
# +++ b/CMakeLists.txt
# @@ -3,7 +3,7 @@
#  cmake_minimum_required(VERSION 3.21)
#  
#  # Set your project name. This will be the name of your SKSE .dll file.
# -project(HelloWorld VERSION 0.0.1 LANGUAGES CXX)
# +project(HelloWorld_SkScr_YT_Series VERSION 0.0.1 LANGUAGES CXX)
#  
#  # #
#  # YOU DO NOT NEED TO EDIT ANYTHING BELOW HERE
### END GIT COMMIT BEFORE AMEND

System Info (please complete the following information):

  • OS: [e.g. Windows, macOS, linux]
  • Version [e.g. v0.5.1] (Note only the latest 0.x version is supported)

Additional context
Add any other context about the problem here.

Experiencing similar issues, removed a single line print statement in some swift code, the generated commit included

- Remove unnecessary print statement
- adjust ContentView width and height
- Refactor CommandGroup actions
- Add help button in CommandGroup

I can confirm that this happens on short diffs. We should update the prompt to handle these cases. Open to PRs here