7 comments

[ 3.5 ms ] story [ 33.4 ms ] thread
Cool, I just recently wrote a Python script to automate commit messages using ChatGPT [1]. Since then I was working on GPT powered scripts similar to loz, but did not publish it anywhere yet.

[1] https://github.com/jen-ya/commitgpt

Thank you for sharing that. I will give it a try.
This is great! Github Copilot used to summarize our PRs - I think it can work perfectly as a Github workflow to add comments to newly opened PRs. Can be a nice experiment to use multiple models and compare the comments to determine what works better.
We have a guy using LLMs for generating things like this at work. I’d rather he didn’t.

The AI doesn’t understand business or product context, only the code. It can’t explain _why_ the change was made or the higher level reasoning or impacts which are the main point—the “what” is already present in the diff.

A commit or MR that says “Added a method to the controller that calls the new `frobulate` method on FooService” answers none of the questions someone would have looking back at this in six months and provides no helpful information for someone trying to debug or modify it later.

I’d argue that a commit message is not the place for (detailed) business reasoning. Sure put a link to the issue that contains the requirement / fix details - better yet have it auto-link based on an identifier. Personally I’d much rather see a brief description of the technical change and if there’s any hard to grasp concepts.
Commit messages derived from only code differences (doesn't matter whether they are generated by human or LLM) are generally useless.

A commit message should describe the context and reasoning which lead to a code change.

Describing the change itself is pointless, since you have a diff already.

That's a good point. Sometimes LLM generates incorrect GIT messages. I can add the whole source file including diff to the prompt, but it increases the token size. So I will find a good way to add more context to the prompt.