News for hackers. Stuff that matters.
Re:Gptcommit: Never write a commit message again (with the h... by tomtomtom777 on Thursday January 19, 2023 @06:22PM (#34447060)
For me the point of this demo is that even a good commit message is often redundant information.

As programmers we learn that adding a comment like:

   // The limit is 16
to

    const SOME_LIMIT = 16
is bad because is redundant information that serves no purpose to the reader and can easily misalign in the future.

So what's a good commit message for changing this limit? Ideally we want to describe why we've changed it but this information isn't always available so even when we're avoiding redundant comments we often use redundant commit messages like "increased SOME_LIMIT" to make browsing through history easier for others.

As we do not need to provide this information (it is already in the code), it seems like a reasonable idea for an AI to help us provide it.

Re:Gptcommit: Never write a commit message again (with the h... by TeMPOraL on Thursday January 19, 2023 @06:36PM (#34447207)
> Ideally we want to describe why we've changed it but this information isn't always available

I struggle to imagine situation in which this is the case. Surely, even in the worst case of you being told to make a particular change with no explanation given, you can at least drop a "increased from 5 at a request of ${name of your boss}", or "increased from 5, see ticket #${ticket number}" in a comment, and/or a commit message.

Re:Gptcommit: Never write a commit message again (with the h... by flutas on Thursday January 19, 2023 @07:15PM (#34447526)
Something that's standard at the company I work for is commit messages always having the ticket number at the start, and it helps figure out why something was changed so much more than a commit message.

Ex of a recent change I saw, but anonymized a bit.

PROJ-12345: Added preview flag to video player

PROJ-12345 in Jira:

When a preview of a video is playing in the persistent player, preroll ads will display on app launch.

Re:Gptcommit: Never write a commit message again (with the h... by teddyh on Thursday January 19, 2023 @07:30PM (#34447627)
A more standardized format is:

  Bug: #12345
if you want to merely reference a specific bug/issue, or

  Closes: #12345
if this commit fixes the bug/closes the issue.

See https://git.wiki.kernel.org/index.php/CommitMessageConventio...

Re:Gptcommit: Never write a commit message again (with the h... by funcDropShadow on Friday January 20, 2023 @07:46AM (#34452354)
But the PROJ-12345 at the beginning of the first line of the commit is very common in many entreprise projects.
Re:Gptcommit: Never write a commit message again (with the h... by xg15 on Thursday January 19, 2023 @06:56PM (#34447371)
I don't think the situation is comparable. The comment is redundant because typically you see the commented code right next to it, so reading the code is about as much effort as reading the comments.

In contrast, commit messages often stand alone: If you browse the history, you only see the messages, but now a large number of them; if a commit changes more than one file, the commit message has to sum up the changes from all files.

In all those contexts, a simple, high-level description of what has changed can be enormously helpful.

Re:Gptcommit: Never write a commit message again (with the h... by D13Fd on Thursday January 19, 2023 @09:45PM (#34448572)
> In all those contexts, a simple, high-level description of what has changed can be enormously helpful.

Sure, but you are leaving out the point of the original reply -- the GPT-written commit messages are not trustworthy. They will look convincing, but they are likely to have errors.

Re:Gptcommit: Never write a commit message again (with the h... by Hextinium on Thursday January 19, 2023 @11:05PM (#34449115)
I find editing text is easier than writing from blank, this would (if it works) give me a starting condition to them edit from which is helpful.
Re:Gptcommit: Never write a commit message again (with the h... by throwanem on Thursday January 19, 2023 @06:56PM (#34447373)
If you don't know why you're making the change, you are not ready to commit the change.
Re:Gptcommit: Never write a commit message again (with the h... by RheingoldRiver on Thursday January 19, 2023 @08:51PM (#34448232)
Seems like it could be helpful as a starting point for a non-native English speaker though
Re:Gptcommit: Never write a commit message again (with the h... by issa on Thursday January 19, 2023 @09:26PM (#34448454)
usually the more important information in a comment is WHY the code does what it does.