7 ms·
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
by tomtomtom777 4y ago
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.
- TeMPOraL 4y ago> 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.
- flutas 4y agoSomething 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.
- teddyh 4y agoA 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/CommitMessageConventions https://git.wiki.kernel.org/index.php/CommitMessageConventio...
- funcDropShadow 4y agoBut the PROJ-12345 at the beginning of the first line of the commit is very common in many entreprise projects.
- xg15 4y agoI 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.
- D13Fd 4y ago> 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.
- Hextinium 4y agoI 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.
- throwanem 4y agoIf you don't know why you're making the change, you are not ready to commit the change.
- RheingoldRiver 4y agoSeems like it could be helpful as a starting point for a non-native English speaker though
- deleted 4y ago[deleted]
- issa 4y agousually the more important information in a comment is WHY the code does what it does.