microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
308 stars 28 forks source link

Generated commit message style #526

Open MattJeanes opened 10 months ago

MattJeanes commented 10 months ago

I love the new auto generated commit message feature in the VSCode 1.84 release that's just come out.

What I would love to see to make it even better is the ability to customize the style of commit message, for example conventional commits: ci: added yaml build definition or feat: added test controller etc.

Some of our projects at work require conventional commits for example, and given that the underlying tech is just based on prompts I can imagine this being pretty easy to add with a prompt tweak.

It would be even more amazing if you could give it any style by having the option for a custom pre-prompt e.g. "Use conventional commit styling" or "Use relevant emojis at the start of the message".

A suggestion by @digitarald also is that VSCode could be aware of previous commit messages and copy their style too which I think is also a great idea.

Thank you!

kaminskypavel commented 9 months ago

adding for reference. https://www.conventionalcommits.org/en/v1.0.0/

johan-lejdung commented 9 months ago

This would be fantastic. The GitLens plugin has a VSCode setting to modify the prompt it uses to send to OpenAI, so I assume this would be quite simple to change for the prompt to CoPilot as well :)

AliMD commented 9 months ago

Any setting/hack for customize the copilet/gpt prompt before sent?

dasaqui commented 9 months ago

I have the same need to use conventional commits

edouardmisset commented 9 months ago

Same here :)

AhmedY0unes commented 9 months ago

same here 🤞

DADEV2020 commented 9 months ago

same here 🫰

rafaelmfonseca commented 9 months ago

same here 👈

netdjw commented 8 months ago

same here

Khalshim commented 8 months ago

same here

superlevure commented 8 months ago

Please stop posting same here, we get it, VSCode team gets it, the world gets it and it triggers useless notifications for all

netdjw commented 8 months ago

Please stop posting same here, we get it, VSCode team gets it, the world gets it and it triggers useless notifications for all

Sorry :) next time if you posting any answer "we get it", then you can keep calm folks of the Internet

Sam-Lin-MillersLab commented 8 months ago

@superlevure just said something everyone subscribed to this thread wanna said. I am surprised that some still don't know the community rules even they are on Github for such a long time. Maybe it should be a feature request for Github that repo can set a rule to block message like same here, +1 etc.

Just created a feature request. https://github.com/orgs/community/discussions/78033

phily245 commented 7 months ago

We use https://cbea.ms/git-commit/

phily245 commented 7 months ago

We use https://cbea.ms/git-commit/

This follows recommendations by git itself: https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines

michvllni commented 7 months ago

We use https://cbea.ms/git-commit/

This follows recommendations by git itself: https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines

What we are requesting is the possibility to follow conventional commits.

While the recommendations by git provide a valuable basis, conventional commits further increase the readability of commit messages.

Many teams use it because of its integration with semver to automatically generate version numbers via the commit types.

It is common practice to use conventional commits, thus it would be great if the copilot auto commits would also support it.

benjefferies commented 7 months ago

Adding a git commit prompt setting would give the flexibility to define the style of the commit message. This would allow users to choose their preference for the commit message format

lwestfall commented 7 months ago

What we are requesting is the possibility to follow conventional commits.

Not to nitpick, but while the majority of us do want conventional commit support, the issue as written is not specifically for conventional commits and only conventional commits. It's merely used as an example for a broader request to customize the prompt to support whatever style the developer prefers.

If @phily245 also wants to be able to support some other spec too that's fine.

michvllni commented 7 months ago

What we are requesting is the possibility to follow conventional commits.

Not to nitpick, but while the majority of us do want conventional commit support, the issue as written is not specifically for conventional commits and only conventional commits. It's merely used as an example for a broader request to customize the prompt to support whatever style the developer prefers.

If @phily245 also wants to be able to support some other spec too that's fine.

Yes, sorry you are correct. It has been quite some time since I had this issue open last and I forgot it's not only about conventional commits

jcbowyer commented 5 months ago

Adding my voice here as well, given that this issue has been outstanding for some time. I believe implementing this feature would significantly enhance the efficiency of numerous development teams, allowing us to allocate our time more effectively.

MattJeanes commented 4 months ago

The March update of VSCode includes improvements to this:

https://code.visualstudio.com/updates/v1_88#_commit-message-generation-improvements

To improve the quality of the generated commit messages, we are now also including the commit messages of the 10 most recent commits in the repository, and the commit messages of the 10 most recent commits of the current user as extra context.

This is fantastic and will have to see how well this works. A custom prompt would still be useful but this will likely solve the issue in most use cases.

kaminskypavel commented 4 months ago

The March update of VSCode includes improvements to this:

https://code.visualstudio.com/updates/v1_88#_commit-message-generation-improvements

To improve the quality of the generated commit messages, we are now also including the commit messages of the 10 most recent commits in the repository, and the commit messages of the 10 most recent commits of the current user as extra context.

This is fantastic and will have to see how well this works. A custom prompt would still be useful but this will likely solve the issue in most use cases.

this is such a clever idea! i haven't tested it very thoroughly, but on the surface it seems to work! kudos! 🤗

misaelmoreno commented 4 months ago

The update represents an improvement without a doubt, but it would be incredible to be able to determine a custom pattern as context... for example, my company has strict rules like writing the commit in lowercase, including the ticket number, or not exceeding 100 characters. The message generation is perfect, but I need to fix a lot before I can commit.

julien-blanchon commented 4 months ago

Gitbutler have a similar features that follow conventionalcommits. I think this would a very good improvement to vscode

Jossec101 commented 3 months ago

This is really needed! A custom message style would match each team's own way of writing commits

movahhedi commented 3 months ago

I don't know how, but GitHub Copilot is giving me conventional-commits-style messages today.

VSCode version: 1.89.1 GitHub Copilot extension version: v1.190.0

lexfrei commented 3 months ago

@movahhedi it just checks last 10 commit messages and tries to mimic.

jorismak commented 3 months ago

So, for someone who wants to disable this? It now puts 'chore' in front of every message it generates :(.

1forh commented 3 months ago

I'm getting the same thing. Doesn't seem to be looking at previous commits. It just uses conventional-commits-style.

musuyaba commented 3 months ago

The March update of VSCode includes improvements to this: https://code.visualstudio.com/updates/v1_88#_commit-message-generation-improvements

To improve the quality of the generated commit messages, we are now also including the commit messages of the 10 most recent commits in the repository, and the commit messages of the 10 most recent commits of the current user as extra context.

This is fantastic and will have to see how well this works. A custom prompt would still be useful but this will likely solve the issue in most use cases.

this is such a clever idea! i haven't tested it very thoroughly, but on the surface it seems to work! kudos! 🤗

image Oh, fantastic. The latest feature just reads the last 10 commits and spits out the same sentences. Why not just commit the entire alphabet and have it increment by letter? Sorry, this is genius 🙄

tomerh2001 commented 2 months ago

Even with the last ten commits, it still sometimes generates an extremely long and weird commit message, for example:

Refactor lodash import in activity-ad-set.ts

The code changes in `src/models/mongo/activity-ad-set.ts` refactor the import statement for the lodash library. The unnecessary `type String` import is removed, and the import for the default lodash module is updated to use the correct syntax.

This commit message follows the established convention of starting with a verb in the imperative form and providing a clear and concise description of the changes.

It generated this redundantly long commit for this change:

- import _, {type String} from 'lodash';
+ import _ from 'lodash';

This simple change to remove an unused import should not receive this long commit message. Also, we use conventional commits; all the previous commit messages follow that pattern, but the generated message doesn't adhere to them.

Edit: Lol, I didn't even notice the This commit message follows the established convention of starting with a verb in the imperative form and providing a clear and concise description of the changes in the commit message! This is ridiculous.

derrix060 commented 1 month ago

I was able to improve how the commit messages are by adding this to my settings.json:

"gitlens.experimental.generateCommitMessagePrompt": "Now, please generate a commit message. Ensure that it includes a precise and informative subject line that succinctly summarizes the crux of the changes in under 50 characters. If necessary, follow with an explanatory body providing insight into the nature of the changes, the reasoning behind them, and any significant consequences or considerations arising from them. Conclude with any relevant issue references at the end of the message.  Make sure that the body is separated from the subject line by a blank line.  For more information, refer to the following resources:  - https://chris.beams.io/posts/git-commit/  - https://www.conventionalcommits.org/en/v1.0.0/.  Also, make sure the lengh of each line for the commit message is less than 72 characters.",
jorismak commented 1 month ago

That's a setting for GitLens. Are you sure it's working for copilot ? Or are you using GitLens ai-commit messages without realizing it ?

(Yes, it could very well be that copilot uses the same setting key, I honestly don't know )

derrix060 commented 1 month ago

Yeah, this was for gitlens, sorry. It would be really cool if copilot would expose the prompt so we could configure it

Sam-Lin-MillersLab commented 1 month ago

Yeah, this was for gitlens, sorry. It would be really cool if copilot would expose the prompt so we could configure it

Thanks for testing it nevertheless

PandaCoffeeBara commented 1 month ago

Well with the knowledge that, github copilot does try to mimic the last few N number of commit message formats, If I enforce the project's commits to follow a format than soon the formatting won't be an issue, which in all honesty works for me

caendesilva commented 3 weeks ago

Well with the knowledge that, github copilot does try to mimic the last few N number of commit message formats, If I enforce the project's commits to follow a format than soon the formatting won't be an issue, which in all honesty works for me

For me it's not at all mimicking the last commits. Would love to be able to modify the prompt context.