Open robellegate opened 1 year ago
This could possibly be implemented via #70, but with the addition of re-generating the commit message based on user feedback.
@robellegate thanks for that! do you want to make a PR? I would play instead with the few-shot examples in the prompt, maybe it can be solved more UX friendly.
if not — I dont think #70 is the way to go, cause we have oco hook set
which allows you to edit messages in your IDE of choice when running git commit
(with no -m
flag) or any alias you have
if there is no easier way — we could do something like this:
ASK_PURPOSE=boolean
, default false
ASK_PURPOSE=true
=> before going to openAI api for the message we prompt user for sharing the purposeThen it would ask the purpose for every commit... I'd rather have something that's set per-commit.
That's why I thought an optional argument would be the best solution. However, I could also see this working with improved UI/UX with an edit option that opens up a conversational chat where the changes the user wants made to the commit message are done via chat instead of direct editing of the commit message.
Sent from Yahoo Mail on Android
On Thu, Jun 15, 2023 at 0:45, Sébastien @.***> wrote:
Then it would ask the purpose for every commit... I'd rather have something that's set per-commit.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
That's why I thought an optional argument would be the best solution. However, I could also see this working with improved UI/UX with an edit option that opens up a conversational chat where the changes the user wants made to the commit message are done via chat instead of direct editing of the commit message.
It seems a better option. That doesn't seem complex to implement given cleye
documentation, @robellegate would you like to push a PR?
Stale issue message
Description
I would like to request a feature that allows users to inform Opencommit of the purpose of a commit. This will enable Opencommit to generate more descriptive and specific commit messages based on the user's input. For example, running
oc "fix violation of Markdownlint rule MD034"
would result in a suggested commit of:":rotating_light: lint(idea-intake.md): fix bare urls violation" "This commit wraps the email address in angle brackets to adhere to the markdownlint rule MD034, which disallows the use of bare URLs. The change resolves the linting error and ensures better compatibility with various markdown parsers."
Suggested Solution
To implement this feature, Opencommit can be extended to accept an optional argument that describes the purpose of the commit. The input can be parsed to extract relevant information (e.g., lint rule violations) and used to generate a commit message that reflects the user's input.
Alternatives
An alternative solution could be to allow users to inform Opencommit of the purpose during interactive usage of
oc
, without requiring an extra argument. This can be achieved by prompting the user to provide a description of the commit's purpose after they are presented with the generated commit message. Opencommit can then use this input to re-generate a more informative and context-specific commit message. This approach keeps the command-line interface clean while still enabling users to provide additional information for generating better commit messages.Additional Context
The primary goal of this feature is to make commit messages more informative and relevant by allowing users to provide context-specific information. By generating commit messages that accurately describe the purpose of a commit, it will be easier for project maintainers and contributors to understand the changes made in each commit, ultimately improving the overall quality and maintainability of the project.