zurawiki / gptcommit Goto Github PK
View Code? Open in Web Editor NEWA git prepare-commit-msg hook for authoring commit messages with GPT-3.
License: MIT License
A git prepare-commit-msg hook for authoring commit messages with GPT-3.
License: MIT License
Based on the multiple diff, can we summarise a sentence for creating Pull Request?
Also, I think we can add some configurations to ignore some files
i love this tool. it's very nice!
how to generate commit message in other language?
When using git commit --amend
gptcommit always replaces the last commit message with the same generic message:
# AI Generated Commit Summary:
# EDIT BELOW AS NEEDED
- Refactor backend code to improve performance
- Update frontend design to improve user experience
- Add new features to improve application functionality
#
# File-level changes:
~
Hi,
I've got this problem, do you have any idea?
It seems like error from docker.
➤ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-updates
stable-x86_64-unknown-linux-gnu unchanged - rustc 1.67.0 (fc594f156 2023-01-24)
info: cleaning up downloads & tmp directories
╰─➤ cat .git/hooks/prepare-commit-msg
───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: .git/hooks/prepare-commit-msg
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ #!/bin/sh
2 │
3 │ ### BEGIN GPTCOMMIT HOOK ###
4 │ gptcommit prepare-commit-msg --commit-msg-file "$1" --commit-source "$2" --commit-sha "$3"
5 │ ### END GPTCOMMIT HOOK ###
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
╰─➤ RUST_LOG=trace git commit
the input device is not a TTY
As the question, if I would like to have [feat] ......
rather than feat: ......
, how could I do it? Does this need any code changes? Or it can be done with the current configuration?
Need a breakdown of changes when the new version is released so that we can better implement the new features into the downstream tools.
error[E0433]: failed to resolve: could not find `unix` in `os`
--> C:\Users\mk\scoop\persist\rustup-msvc\.cargo\registry\src\github.com-1ecc6299db9ec823\gptcommit-0.1.0\src\actions\install.rs:4:27
|
4 | process::Command, os::unix::prelude::PermissionsExt,
| ^^^^ could not find `unix` in `os`
error[E0599]: no function or associated item named `from_mode` found for struct `Permissions` in the current scope
--> C:\Users\mk\scoop\persist\rustup-msvc\.cargo\registry\src\github.com-1ecc6299db9ec823\gptcommit-0.1.0\src\actions\install.rs:45:64
|
45 | fs::set_permissions(&prepare_commit_msg_path, Permissions::from_mode(0o755))?;
| ^^^^^^^^^ function or associated item not found in `Permissions`
Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `gptcommit` due to 2 previous errors
error: failed to compile `gptcommit v0.1.0`, intermediate artifacts can be found at `C:\Users\mk\AppData\Local\Temp\cargo-installdYv1GZ`
Hi zurawiki,
My OpenAI account is currently kept unpaid, which resulted in rate limitation failures on large (maybe?) patchsets:
$ git commit
🤖 Asking GPT-3 to summarize diffs...
2023-02-09T16:33:58.976Z WARN [gptcommit::openai] skipping... token count: 4552 < 4097
2023-02-09T16:33:58.980Z WARN [gptcommit::openai] skipping... token count: 4092 < 4097
2023-02-09T16:33:58.988Z WARN [gptcommit::openai] skipping... token count: 4310 < 4097
2023-02-09T16:33:58.988Z WARN [gptcommit::openai] skipping... token count: 4252 < 4097
2023-02-09T16:33:58.992Z WARN [gptcommit::openai] skipping... token count: 17654 < 4097
Error: Unexpected JSON response:
{"error":{"code":null,"message":"Rate limit reached for default-text-davinci-003 in organization org-xxxxxx on requests per min. Limit: 60.000000 / min. Current: 70.000000 / min. Contact [email protected] if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method.","param":null,"type":"requests"}}
$ git diff --staged --shortstat
28 files changed, 2854 insertions(+)
The error occurs mid-execution, so the requests before the error were dropped. Retries may cause additional overhead in the costing. (related to #41)
Switching to a mature OpenAI API client (#20) could probably solve this problem, but before doing so, an additional configuration to limit the request rate will also come in handy.
How to use it with this project?
https://github.com/streamich/git-cz
Tip: Skipping gptcommit because the githook isn't set up for the "Message" commit mode.
I think it would be good to have it as an option for verification purposes -- to check if the summary really captures the gist of the diff.
I'm having a hard time finding a way to install it into github codespace.
When I run brew upgrade gptcommit
it returns Warning: zurawiki/brews/gptcommit 0.1.13 already installed
Is there any way to let gptcommit use proxy to make requests?
When trying to set gptcommit config set openai.model gpt-3.5-turbo
after that, when using gptcommit, It shows the error
OpenAI error: This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?
reference: https://openai.com/blog/introducing-chatgpt-and-whisper-apis
Is it possible for us to disable per-file summary?
Sometimes there might be just one file or a few files changed. The per-file summary might be redundant with the main title and summary.
It's also useful to save costs.
The first version of gptcommit
uses text-davinci-003
in a hardcoded way that can't be customized.
See code snippet:
Lines 12 to 20 in 257ff00
gptcommit should have a configuration system in place that allows users to select different models and other parameters.
This should be done after #20 is closed, to eliminate duplication of work
I have completed the relevant code and it is in my forked repository.
I did the following things:
check
option to verify the local network environment.Why I add check
option
Recently, there is a type of software called OpenAI Translator. The translator that does more than just translation - powered by OpenAI.
The author is distressed by some negative reviews because some users' OpenAI account was banned due to their local network issues.
I have referred to the strategy of OpenAI Translator and added a 'check' option to check the user's local network conditions.
If you think this proposal is useful, I will submit a PR.
If you think checking the local network environment is the user's own responsibility, then ignore this proposal.
Hi, I just wanted to try the tool because I think it is a really great idea but encountered a problem that I can't figure out. I have staged some changes, set my API key and executed gptcommit install in the repository. But when I enter git commit I get the following output:
Error: error sending request for url (https://api.openai.com/v1/completions): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
Caused by:
0: error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution
1: dns error: failed to lookup address information: Temporary failure in name resolution
2: failed to lookup address information: Temporary failure in name resolution
When I try to make a request to the completions API using curl, it works.
Thanks in advance!
Hello I'm totally not into Rust environment. Decided to share it and luckily get some valid answer instead of copy pasting dunno what.
rra@whatisthat:~/Documents/siemens/SDI/build-image$ cargo install --locked gptcommit
Updating crates.io index
Installing gptcommit v0.1.4
error: failed to compile `gptcommit v0.1.4`, intermediate artifacts can be found at `/tmp/cargo-installBD3IP0`
Caused by:
package `clap_lex v0.3.1` cannot be built because it requires rustc 1.64.0 or newer, while the currently active rustc version is 1.61.0
rra@workmachine:~/Documents/siemens/SDI/build-image$
Today, we use a naive HTTP request to get the OpenAI completions using the reqwest
library.
Some benefits of a better API client
We should use a more robust API client library. I saw a few choices on lib.rs: https://lib.rs/search?q=openai but there isn't any library that is officially supported by OpenAI
async-openai https://lib.rs/crates/async-openai looks promising but isn't v1
Running the command gptcommit config set openai.api_key sk-...
the first time produced a config.toml
which had group and world read permissions enabled (0644). Since this file contains an API key, seems like a good idea to create it with user read permissions only (0600).
I found that setting custom base URL to openai.api_base
key with CLI is not working, just works for openai.api_key
.
my device info:
$ gptcommit config set openai.api_base "XXXXXXX" -v
2023-03-27T08:22:20.551Z DEBUG [gptcommit::settings] Using home dir at /Users/Bobot
2023-03-27T08:22:20.551Z DEBUG [gptcommit::settings] Found config dir at /Users/Bobot/.config/gptcommit
2023-03-27T08:22:20.551Z DEBUG [gptcommit::settings] Applying config file at /Users/Bobot/.config/gptcommit/config.toml
2023-03-27T08:22:20.558Z INFO [gptcommit::git] Repo path from git: Output { status: ExitStatus(unix_wait_status(0)), stdout: "/Users/Bobot/Repositories/xvautomator\n.git/hooks\n", stderr: "" }
2023-03-27T08:22:20.558Z INFO [gptcommit::git] Creating dir at .git/hooks
2023-03-27T08:22:20.558Z DEBUG [gptcommit::settings] Applying config from GPTCOMMIT__*: Ok({"openai_api_base": Value { origin: Some("the environment"), kind: String("XXXXXXXX") }})
2023-03-27T08:22:20.559Z DEBUG [gptcommit] Settings: Settings { model_provider: Some(OpenAI), openai: Some(OpenAISettings { api_key: Some("my-personal-key"), model: Some("gpt-3.5-turbo"), retries: Some(2) }), prompt: Some(PromptSettings { conventional_commit_prefix: Some("You are an expert programmer, and you are trying to summarize a code change.\nYou went over every file that was changed in it.\nFor some of these files changes where too big and were omitted in the files diff summary.\nDetermine the best label for the commit.\n\nHere are the labels you can choose from:\n\n- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\n- chore: Updating libraries, copyrights or other repo setting, includes updating dependencies.\n- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, GitHub Actions)\n- docs: Non-code changes, such as fixing typos or adding new documentation\n- feat: a commit of the type feat introduces a new feature to the codebase\n- fix: A commit of the type fix patches a bug in your codebase\n- perf: A code change that improves performance\n- refactor: A code change that neither fixes a bug nor adds a feature\n- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\n- test: Adding missing tests or correcting existing tests\n\n\nTHE FILE SUMMARIES:\n###\n{{ summary_points }}\n###\n\nThe label best describing this change:\n"), commit_summary: Some("You are an expert programmer, and you are trying to summarize a pull request.\nYou went over every file that was changed in it.\nFor some of these files changes were too big and were omitted in the files diff summary.\nPlease summarize the pull request.\nWrite your response in bullet points, using the imperative tense following the pull request style guide.\nStarting each bullet point with a `-`.\nWrite a high level description. Do not repeat the commit summaries or the file summaries.\nWrite the most important bullet points. The list should not be more than a few bullet points.\n\nTHE FILE SUMMARIES:\n###\n{{ summary_points }}\n###\n\nRemember to write only the most important points and do not write more than a few bullet points.\nTHE PULL REQUEST SUMMARY:\n\n"), commit_title: Some("You are an expert programmer, and you are trying to title a pull request.\nYou went over every file that was changed in it.\nFor some of these files changes were too big and were omitted in the files diff summary.\nPlease summarize the pull request into a single specific theme.\nWrite your response using the imperative tense following the kernel git commit style guide.\nWrite a high level title.\nDo not repeat the commit summaries or the file summaries.\nDo not list individual changes in the title.\n\nEXAMPLE SUMMARY COMMENTS:\n```\nRaise the amount of returned recordings\nSwitch to internal API for completions\nLower numeric tolerance for test files\nSchedule all GitHub actions on all OSs\n```\n\nTHE FILE SUMMARIES:\n###\n{{ summary_points }}\n###\n\nRemember to write only one line, no more than 50 characters.\nTHE PULL REQUEST TITLE:\n"), file_diff: Some("You are an expert programmer, and you are trying to summarize a git diff.\nReminders about the git diff format:\nFor every file, there are a few metadata lines, like (for example):\n```\ndiff --git a/lib/index.js b/lib/index.js\nindex aadf691..bfef603 100644\n--- a/lib/index.js\n+++ b/lib/index.js\n```\nThis means that `lib/index.js` was modified in this commit. Note that this is only an example.\nThen there is a specifier of the lines that were modified.\nA line starting with `+` means it was added.\nA line that starting with `-` means that line was deleted.\nA line that starts with neither `+` nor `-` is code given for context and better understanding.\nIt is not part of the diff.\nAfter the git diff of the first file, there will be an empty line, and then the git diff of the next file.\n\nDo not include the file name as another part of the comment.\nDo not use the characters `[` or `]` in the summary.\nWrite every summary comment in a new line.\nComments should be in a bullet point list, each line starting with a `-`.\nThe summary should not include comments copied from the code.\nThe output should be easily readable. When in doubt, write less comments and not more. Do not output comments that simply repeat the contents of the file.\nReadability is top priority. Write only the most important comments about the diff.\n\nEXAMPLE SUMMARY COMMENTS:\n###\n- Raise the amount of returned recordings from `10` to `100`\n- Fix a typo in the github action name\n- Move the `octokit` initialization to a separate file\n- Add an OpenAI API for completions\n- Lower numeric tolerance for test files\n- Add 2 tests for the inclusive string split function\n###\nMost commits will have less comments than this examples list.\nThe last comment does not include the file names,\nbecause there were more than two relevant files in the hypothetical commit.\nDo not include parts of the example in your summary.\nIt is given only as an example of appropriate comments.\n\n\nTHE GIT DIFF TO BE SUMMARIZED:\n###\n{{ file_diff }}\n###\n\nTHE SUMMARY:\n\n"), translation: Some("You are a professional programmer and translator, and you are trying to translate a git commit message.\nYou want to ensure that the translation is high level and in line with the programmer's consensus, taking care to keep the formatting intact.\n\nNow, translate the following message into {{ output_language }}.\n\nGIT COMMIT MESSAGE:\n\n###\n{{ commit_message }}\n###\n\nRemember translate all given git commit message.\nTHE TRANSLATION:\n") }), output: Some(OutputSettings { conventional_commit: Some(true), lang: Some("en"), show_per_file_summary: Some(false) }), allow_amend: Some(true), file_ignore: Some(["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "Cargo.lock"]) }
2023-03-27T08:22:20.559Z DEBUG [gptcommit::actions::config] Config subcommand - Settings = Settings { model_provider: Some(OpenAI), openai: Some(OpenAISettings { api_key: Some("my-personal-key"), model: Some("gpt-3.5-turbo"), retries: Some(2) }), prompt: Some(PromptSettings { conventional_commit_prefix: Some("You are an expert programmer, and you are trying to summarize a code change.\nYou went over every file that was changed in it.\nFor some of these files changes where too big and were omitted in the files diff summary.\nDetermine the best label for the commit.\n\nHere are the labels you can choose from:\n\n- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)\n- chore: Updating libraries, copyrights or other repo setting, includes updating dependencies.\n- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, GitHub Actions)\n- docs: Non-code changes, such as fixing typos or adding new documentation\n- feat: a commit of the type feat introduces a new feature to the codebase\n- fix: A commit of the type fix patches a bug in your codebase\n- perf: A code change that improves performance\n- refactor: A code change that neither fixes a bug nor adds a feature\n- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\n- test: Adding missing tests or correcting existing tests\n\n\nTHE FILE SUMMARIES:\n###\n{{ summary_points }}\n###\n\nThe label best describing this change:\n"), commit_summary: Some("You are an expert programmer, and you are trying to summarize a pull request.\nYou went over every file that was changed in it.\nFor some of these files changes were too big and were omitted in the files diff summary.\nPlease summarize the pull request.\nWrite your response in bullet points, using the imperative tense following the pull request style guide.\nStarting each bullet point with a `-`.\nWrite a high level description. Do not repeat the commit summaries or the file summaries.\nWrite the most important bullet points. The list should not be more than a few bullet points.\n\nTHE FILE SUMMARIES:\n###\n{{ summary_points }}\n###\n\nRemember to write only the most important points and do not write more than a few bullet points.\nTHE PULL REQUEST SUMMARY:\n\n"), commit_title: Some("You are an expert programmer, and you are trying to title a pull request.\nYou went over every file that was changed in it.\nFor some of these files changes were too big and were omitted in the files diff summary.\nPlease summarize the pull request into a single specific theme.\nWrite your response using the imperative tense following the kernel git commit style guide.\nWrite a high level title.\nDo not repeat the commit summaries or the file summaries.\nDo not list individual changes in the title.\n\nEXAMPLE SUMMARY COMMENTS:\n```\nRaise the amount of returned recordings\nSwitch to internal API for completions\nLower numeric tolerance for test files\nSchedule all GitHub actions on all OSs\n```\n\nTHE FILE SUMMARIES:\n###\n{{ summary_points }}\n###\n\nRemember to write only one line, no more than 50 characters.\nTHE PULL REQUEST TITLE:\n"), file_diff: Some("You are an expert programmer, and you are trying to summarize a git diff.\nReminders about the git diff format:\nFor every file, there are a few metadata lines, like (for example):\n```\ndiff --git a/lib/index.js b/lib/index.js\nindex aadf691..bfef603 100644\n--- a/lib/index.js\n+++ b/lib/index.js\n```\nThis means that `lib/index.js` was modified in this commit. Note that this is only an example.\nThen there is a specifier of the lines that were modified.\nA line starting with `+` means it was added.\nA line that starting with `-` means that line was deleted.\nA line that starts with neither `+` nor `-` is code given for context and better understanding.\nIt is not part of the diff.\nAfter the git diff of the first file, there will be an empty line, and then the git diff of the next file.\n\nDo not include the file name as another part of the comment.\nDo not use the characters `[` or `]` in the summary.\nWrite every summary comment in a new line.\nComments should be in a bullet point list, each line starting with a `-`.\nThe summary should not include comments copied from the code.\nThe output should be easily readable. When in doubt, write less comments and not more. Do not output comments that simply repeat the contents of the file.\nReadability is top priority. Write only the most important comments about the diff.\n\nEXAMPLE SUMMARY COMMENTS:\n###\n- Raise the amount of returned recordings from `10` to `100`\n- Fix a typo in the github action name\n- Move the `octokit` initialization to a separate file\n- Add an OpenAI API for completions\n- Lower numeric tolerance for test files\n- Add 2 tests for the inclusive string split function\n###\nMost commits will have less comments than this examples list.\nThe last comment does not include the file names,\nbecause there were more than two relevant files in the hypothetical commit.\nDo not include parts of the example in your summary.\nIt is given only as an example of appropriate comments.\n\n\nTHE GIT DIFF TO BE SUMMARIZED:\n###\n{{ file_diff }}\n###\n\nTHE SUMMARY:\n\n"), translation: Some("You are a professional programmer and translator, and you are trying to translate a git commit message.\nYou want to ensure that the translation is high level and in line with the programmer's consensus, taking care to keep the formatting intact.\n\nNow, translate the following message into {{ output_language }}.\n\nGIT COMMIT MESSAGE:\n\n###\n{{ commit_message }}\n###\n\nRemember translate all given git commit message.\nTHE TRANSLATION:\n") }), output: Some(OutputSettings { conventional_commit: Some(true), lang: Some("en"), show_per_file_summary: Some(false) }), allow_amend: Some(true), file_ignore: Some(["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "Cargo.lock"]) }
2023-03-27T08:22:20.559Z DEBUG [gptcommit::settings] Using home dir at /Users/Bobot
2023-03-27T08:22:20.559Z DEBUG [gptcommit::settings] Found config dir at /Users/Bobot/.config/gptcommit
2023-03-27T08:22:20.559Z DEBUG [gptcommit::settings] Applying config file at /Users/Bobot/.config/gptcommit/config.toml
2023-03-27T08:22:20.566Z INFO [gptcommit::git] Repo path from git: Output { status: ExitStatus(unix_wait_status(0)), stdout: "/Users/Bobot/Repositories/xvautomator\n.git/hooks\n", stderr: "" }
2023-03-27T08:22:20.566Z INFO [gptcommit::git] Creating dir at .git/hooks
2023-03-27T08:22:20.566Z DEBUG [gptcommit::settings] Applying config from GPTCOMMIT__*: Ok({"openai_api_base": Value { origin: Some("the environment"), kind: String("XXXXXXXXX") }})
openai.api_base = XXXXXXXXX
Config saved to /Users/Bobot/.config/gptcommit/config.toml
Then, there still isn't a key named openai.api_base
:
$ gptcommit config keys
allow_amend
file_ignore
model_provider
openai.api_key
openai.model
openai.retries
output.conventional_commit
output.lang
output.show_per_file_summary
prompt.commit_summary
prompt.commit_title
prompt.conventional_commit_prefix
prompt.file_diff
prompt.translation
I've built my own nginx to reverse proxy api.openai.com
to bypass regional access restrictions.
Is it possible to add a configuration to sets the custom API server?
The first version of gptcommit
uses hardcoded prompts in a hardcoded way that can't be customized.
See code snippet:
Line 4 in 257ff00
gptcommit should have a configuration system in place that allows users to customize the summary prompts as needed. Maybe to start, users would bring their own "few-shot" examples
Please add support for Azure OpenAI service that now has General Availability (GA), including the GPT-3 model.
gc
🤖 Asking GPT-3 to summarize diffs...
Error: Unexpected JSON response:
{"error":{"code":null,"message":"You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions.","param":"model","type":"invalid_request_error"}}
is there way to customize your prompt template?
It would be great to be able to install this tool via brew
. Not a rust dev so installing via cargo required me to install cargo first, which is a pain.
Could you commit the cargo.lock file ? I'm looking to package this for nixos.
This is my test case
I made some minor changes ( for testing purpose )
I run git add .
And then I run git commit
After that, I received this
🤖 Asking GPT-3 to summarize diffs...
Error: Could not decode JSON respose ( a typo )
Is there a verbose mode, so that the user will know what the error is and act accordingly ?
Thanks
like gptcommit uninstall
to do rm .git/hooks/pre-commit
or something like that
As you know, OpenAI is not available in some regions, so maybe some users need to set up a proxy for it.
I'm keep getting the error
Error: invalid_request_error: Incorrect API key provided: sk-eKEmW***************************************pG63. You can find your API key at https://platform.openai.com/account/api-keys.
This is the first API key I set, which is invalid. However, I've updated the valid API key, in config.toml
, but this error persist and keep showing the old API-key.
I tried restart and reinstall, but doesn't work.
After resolving issue #2 commit message is not overwritten by git commit --amend
, however, there are still use cases when one would want to overwrite the commit message.
How about to add something like --force
option to allow users to force overwrite commit messages?
I've configured diff.external=difft
in ~/.gitconfig
(see Difftastic), so the output format of git diff
is quite different from the default behavior of Git. With gptcommit, the generated commit message is always too generic, e.g.:
Refactor outdated code for improved performance
- Refactors code to improve performance
- Implements new feature that enhances user experience
- Fixes bug that was causing errors for a group of users
- Improves documentation for better comprehension and maintenance
If I remove the diff.external
setting in ~/.gitconfig
, the gptcommit generated commit message is more accurate:
Refactor protobufs for improved readability and accuracy
- Remove `crlf_end_of_line` option in `formats.cpp` for cleaner code.
- Adjust line positions, modify metadata, and reorganize submessages in `algebra.proto` for better readability and consistency.
- Revise `CsvReadOptions` and adjust indices and options within `FileOrFiles` message definition, resulting in more accurate schema inference.
To solve this issue, I suggest adding option --no-ext-diff
when running git diff
. In this way, Git will not use the configured external diff tool when generating diff. The option can be added either by default or by a new gptcommit config.
Greetings,
out of curiosity I tried out gptcommit
yesterday for the first time with three commits. Two of them were a bit larger with 265 additions and 214 deletions according to git. Much to my surprise there were two dozen requests and got billed for $0.55. I'd like to ask whether it's expected that the amount of requests (and thus the price) is that high or whether this might indicate a bug?
Just want to say thank you for developing this.
I've wrapped this into a VS Code extension.
https://github.com/pwwang/vscode-gptcommit
https://marketplace.visualstudio.com/items?itemName=pwwang.gptcommit
See if you are interested in contributing as well.
Now, gptcommit
uses a global configuration, including API keys, prompts, etc. Is it possible to have per-project configurations?
For example, with a per-project prompt
, I can have only title
s for some projects, or I can add some specific characters in the messages, for example, some emojis.
One solution I can think of is to have a configuration file ./.gptcommit/config.toml
, which overwrites the global one.
It is also helpful for us to use different API keys and track their usage for different projects.
If it would cut the diff messages to 50k for example?
Suggestion: Add support for Semantic Versioning, using tags ( such as [dev] [chore] [fix] [perf]) appropriately
Why: Semantic is a widely known standard for commit messages which are compiled to make a description of new releases. https://github.com/semantic-release/semantic-release
How: Add [dev] [chore] etc... in the commit message ; might be wrong but we are editing the message already anyway
What: Maybe a configuration that we could setup to automaticly prefix the commit message, maybe there is a way to hack this in without modifying the code too much ?
Error: Unexpected JSON response:
{"error":{"code":null,"message":"Invalid URL (POST /v1/completions1)","param":null,"type":"invalid_request_error"}}
When running "git commit". (Ensured that OPENAI_API_KEY is properly set.)
I'm getting this error since a few days ago, even with new api key:
Error: insufficient_quota: You exceeded your current quota, please check your plan and billing details.
Hey there,
Thanks for creating this tool for the community. It looks very interesting on the demos.
I managed to install it using cargo and also installed the git hook on my existing git repo. I can see the git hook prepare-commit-msg
file showing up in the hook folder. However, it won't run whenever I tried to run git commit
(with or without flags) command. I had the OPENAI_API_KEY
env variable setup and activated already on my machine. What do you think might be the problem?
Thanks again for your attention.
Right now, the max summary length is hard-coded and is 3000. I think it would be nice to allow users to change that threshold if needed.
If .git/hooks
doesn't exist,gpcommit install
will fail.
Repro:
mkdir tmp
cd tmp
git init
rm -rf .git/hooks
gptcommit install
The last command will error with:
Installing gptcommit hook...
Error: No such file or directory (os error 2)
Work required:
mkdir -p .git/hooks
Create a new command allowing users to uninstall the githook.
Work involved:
Uninstall
in main.rsuninstall.rs
, implement a main function.
get_hooks_path
include_str!("../../prepare-commit-msg")
checked into this project.src/actions/mod.rs
to expose the module to the crate.Before submitting run just fix
. You may need to run the command multiple times until there are no more file changes.
I have a fresh install of gptcommit-0.1.9
When I'm trying to set openai.api_key
like so:
gptcommit config set openai.api_key sk-…
it fails with this error:
thread 'main' panicked at 'Could not find user config path', /home/…/.cargo/registry/src/github.com-1ecc6299db9ec823/gptcommit-0.1.9/src/actions/config.rs:85:51
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.