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

Make codegpt commit command trigger the git pre-commit hook #131

Open
k0286 opened this issue Nov 10, 2023 · 7 comments
Open

Make codegpt commit command trigger the git pre-commit hook #131

k0286 opened this issue Nov 10, 2023 · 7 comments

Comments

@k0286
Copy link

k0286 commented Nov 10, 2023

Hi,

I hope the codegpt commit can trigger the git pre-commit hook, before generate the commit message.

I know I can install the prepare-commit-hook to the project. But I don't want to use codegpt for every commit.

So I prefer to use codegpt commit when it's needed.

感謝!

@doggy8088
Copy link
Contributor

@k0286 CodeGPT already have git prepare-commit-msg hook built-in.
Just try codegpt hook install to install the hook.

Can you describe more about your requirements? I don't really get what you want.

@k0286
Copy link
Author

k0286 commented Dec 5, 2023

Thx for your replay.

E.g. I don't want to codegpt been triggered when running git rebase.

But If the prepare-commit-msg hook is intstalled, I don't have any option to disable it except uninstall the hook.

@doggy8088
Copy link
Contributor

Reference from this: https://stackoverflow.com/a/57590865/910074

git rebase runs pre-rebase and post-rewrite hooks. Are you sure your git rebase will trigger prepare-commit-msg hook?

@k0286
Copy link
Author

k0286 commented Dec 7, 2023

Reference from this: https://stackoverflow.com/a/57590865/910074

git rebase runs pre-rebase and post-rewrite hooks. Are you sure your git rebase will trigger prepare-commit-msg hook?

Of course, if you met the conflicts when doing rebase process.

@doggy8088
Copy link
Contributor

I got your point now.

So why do you want to trigger the git pre-commit hook when running codegpt commit? I don't understand why you have to run codegpt commit during git rebase if there is a conflict happen.

@k0286
Copy link
Author

k0286 commented Dec 12, 2023

Yeah, you are right. I actually don't want to codegpt commit been triggered during I'm solving the conflicts. But It triggers if the codegpt commit hook is installed. There are no options to bypass the prepre-commit-message hook, right?

@doggy8088
Copy link
Contributor

@appleboy Do you have any idea?

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

No branches or pull requests

2 participants