Live data from Hacker News

Show HN: Generate commit messages using GPT-3

github.com

31–40 of 73 posts

Re: Show HN: Generate commit messages using GPT-3

#32
I've also started working on something similar: https://github.com/tiborpilz/commitomatic

It was a fun project, and I think I will re-use some parts (prompt generation, selection via fzf), but for the specific use-case I think the assumption that a meaningful commit message can be generated by just looking at the changes is flawed, since it's not really possible to distill intent from a git diff.

Re: Show HN: Generate commit messages using GPT-3

#33
post #9

This creates precisely the kind of commit messages that I regularly scold junior developers for :)" In my opinion, commit messages should clarify the intent of WHY you changed things. I can already see WHAT you changed from the diffs. But of course, any tool can only work with the what, they cannot know that these lines are related to a bug report filed in a technically unrelated system.

Why should the commit message explain why? I thought the point was to give a summary of the changes so that you don’t have to read the full diff.

I think that one doesn't exclude the other.

You can still write a multi-message commit with two messages:

1. Short summary of what is being changed

2. Explain WHY

I think the point is that even if 1. is missing it can be worked-back by reading through the diff. But if 2. is missing then the future generations have no way of finding out reasons behind some decisions.

Re: Show HN: Generate commit messages using GPT-3

#34

This creates precisely the kind of commit messages that I regularly scold junior developers for :)" In my opinion, commit messages should clarify the intent of WHY you changed things. I can already see WHAT you changed from the diffs. But of course, any tool can only work with the what, they cannot know that these lines are related to a bug report filed in a technically unrelated system.

Big disagree on that. I think the commit message should tell me what the change does, not why.

Re: Show HN: Generate commit messages using GPT-3

#35
post #9

This creates precisely the kind of commit messages that I regularly scold junior developers for :)" In my opinion, commit messages should clarify the intent of WHY you changed things. I can already see WHAT you changed from the diffs. But of course, any tool can only work with the what, they cannot know that these lines are related to a bug report filed in a technically unrelated system.

Why should the commit message explain why? I thought the point was to give a summary of the changes so that you don’t have to read the full diff.

The summary of changes can be inferred, or generated automatically with gpt ;)

"Why", on the other hand can be lost.

Especially during refactoring. Let's say you removed some assertion / safety check from a function, because you verified that it's not necessary there. Without explaination in a commit, someone may not get your reasoning.

Same thing with renaming variables, reordering the code etc.

Comments may be useful in some cases, but in many cases there won't be a right place to put them in.

Re: Show HN: Generate commit messages using GPT-3

#36
post #34

This creates precisely the kind of commit messages that I regularly scold junior developers for :)" In my opinion, commit messages should clarify the intent of WHY you changed things. I can already see WHAT you changed from the diffs. But of course, any tool can only work with the what, they cannot know that these lines are related to a bug report filed in a technically unrelated system.

Big disagree on that. I think the commit message should tell me what the change does, not why.

Ideally, both.

'Change rounding to thousandths' isn't overly helpful, and probably apparent.

'Fix overspending bug' is vague.

'Fix overspending issue by rounding to thousandths instead of hundredths' is the ideal commit msg here, as it gives a brief what and why. Possibly even with a ticket number, though I see how after years and switching systems that becomes less useful. More useful is briefly describing the why as a code comment, using good judgement of course.

Re: Show HN: Generate commit messages using GPT-3

#37
post #9

This creates precisely the kind of commit messages that I regularly scold junior developers for :)" In my opinion, commit messages should clarify the intent of WHY you changed things. I can already see WHAT you changed from the diffs. But of course, any tool can only work with the what, they cannot know that these lines are related to a bug report filed in a technically unrelated system.

Why should the commit message explain why? I thought the point was to give a summary of the changes so that you don’t have to read the full diff.

A commit message is made of a title and a body. There is usually more context on why a change was made than can fit in the title.

Re: Show HN: Generate commit messages using GPT-3

#38
post #34

This creates precisely the kind of commit messages that I regularly scold junior developers for :)" In my opinion, commit messages should clarify the intent of WHY you changed things. I can already see WHAT you changed from the diffs. But of course, any tool can only work with the what, they cannot know that these lines are related to a bug report filed in a technically unrelated system.

Big disagree on that. I think the commit message should tell me what the change does, not why.

It's a bit ironic. You just stated your opinion without explaining why you think that way.
Post reply on HN