Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ensure git commit --amend works with prepare-commit-msg hook #179

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

lee1221ee
Copy link
Contributor

When the generated message quality is not good, I use codegpt commit --amend to regenerate the message.

But there are still small parts that need to be modified manually.

Using git commit --amend in the current version will cause the following error:

Error: please add your staged changes using git add <files...>

So I modified the git/templates/prepare-commit-msg file, so that codegpt is not executed when git commit --amend is used.

See the Git Hooks documentation

The second is the source of the commit message, and can be: message (if a -m or -F option was given); template (if a -t option was given or the configuration option commit.template is set); merge (if the commit is a merge or a .git/MERGE_MSG file exists); squash (if a .git/SQUASH_MSG file exists); or commit, followed by a commit object name (if a -c, -C or --amend option was given).

@appleboy appleboy merged commit a37cd88 into appleboy:main Jun 21, 2024
6 of 7 checks passed
@appleboy
Copy link
Owner

@lee1221ee Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants