Live data from Hacker News

Conventional Commits: A specification for structured commit messages

conventionalcommits.org

11–20 of 99 posts

Re: Conventional Commits: A specification for structured commit messages

#11
post #3

> feat: a commit of the type feat introduces a new feature to the codebase instead of 'feat:', why not 'feature:'? I dislike partial abbreviation because it is confusing; yes doc for document and max for maximum make sense but in this case feat is literally a different word?

Tha i wha I cam her t writ a wel. D w reall nee t repea th infamou Uni mistak wit th "creat" syscal? Thin o th childre!

Re: Conventional Commits: A specification for structured commit messages

#12
I'm sticking to the GNU ChangeLog format, thanks.

https://www.gnu.org/prep/standards/html_node/Change-Logs.htm...

This widely used format gives details about what is being done to each function.

This was designed to be used in a ChangeLog file, so it has to be adopted for repository use. We don't have to record the date and name, since that is in the commit meta-data. WE write a commit title, and then the ChangeLog entry becomes the details placed after the blank line. That entry is mandatory: no title-only commits! There can be one or more discussion paragraphs between the title and the ChangeLog entry. We know that these paragraphs aren't ChangeLog entry material because they don't begin with the asterisk.

Like this: http://www.kylheku.com/cgit/txr/commit/?id=b2739251281d7f6ef...

Re: Conventional Commits: A specification for structured commit messages

#13
post #3

> feat: a commit of the type feat introduces a new feature to the codebase instead of 'feat:', why not 'feature:'? I dislike partial abbreviation because it is confusing; yes doc for document and max for maximum make sense but in this case feat is literally a different word?

Because it makes you feel good from sounding like you've just accomplished a feat when you commit the feature.

Re: Conventional Commits: A specification for structured commit messages

#14
post #7
post #3

> feat: a commit of the type feat introduces a new feature to the codebase instead of 'feat:', why not 'feature:'? I dislike partial abbreviation because it is confusing; yes doc for document and max for maximum make sense but in this case feat is literally a different word?

And while we're at it, why don't we just use full sentences? Before: > feat: allow provided config object to extend other configs After > Add option for config object to extend other configs I know this isn't the point of changelogs, but I've been using the verbs from KeepAChangelog to start my commit messages and it's been going well so far. > Add template preview to status page > Change textarea to increase height…

I agree that full sentences (e.g. like Email subjects or blog post titles) are better. Tagging commits with feature/bug/etc is not particularly useful, as more often than not the line between feature, bug, etc is blurry. At times it can also be unclear what tag to use, leading to arbitrary choices. For example: is a performance improvement a feature, or a bug fix? The tags also add no value when reading commit messages.

Setting that aside, the conventional commit "standard" (https://xkcd.com/927/) doesn't focus on what I think is the most important aspect of a commit: a good commit subject and message. In fact, prefixing the subject line with certain tags limits the amount of characters you have for writing the message; assuming you want to stick with the usual 50 character limit.

Re: Conventional Commits: A specification for structured commit messages

#16
post #10

SemVer is generally good practice but I don’t like promotion to religion. For example, during the pre-release of the firebase-functions SDK we shifted SemVer by one: 0.2.1 was a feature addition from 0.2.0 and a breaking change from 0.1. Similarly there are rare cases where I’ve swept breaking changes under the rug because they were severe bug or security fixes that affected a corner case unlikely to be seen in the w…

I believe the first one is semver: before 1.0, anything can change at any time. https://semver.org/

Re: Conventional Commits: A specification for structured commit messages

#17
post #3

> feat: a commit of the type feat introduces a new feature to the codebase instead of 'feat:', why not 'feature:'? I dislike partial abbreviation because it is confusing; yes doc for document and max for maximum make sense but in this case feat is literally a different word?

Commit messages should be short. If you're familiar with conventional commit syntax (and chances are, your team will tell you to follow it, if your repository follows it), then your mind will automatically expand 'feat' to 'feature'.

Re: Conventional Commits: A specification for structured commit messages

#18
post #7

Earlier quoted context omitted.

And while we're at it, why don't we just use full sentences? Before: > feat: allow provided config object to extend other configs After > Add option for config object to extend other configs I know this isn't the point of changelogs, but I've been using the verbs from KeepAChangelog to start my commit messages and it's been going well so far. > Add template preview to status page > Change textarea to increase height…

I agree that full sentences (e.g. like Email subjects or blog post titles) are better. Tagging commits with feature/bug/etc is not particularly useful, as more often than not the line between feature, bug, etc is blurry. At times it can also be unclear what tag to use, leading to arbitrary choices. For example: is a performance improvement a feature, or a bug fix? The tags also add no value when reading commit messag…

> feature/bug/etc is not particularly useful

It's useful for automatically determining the next semantic release version by inspecting the commit history alone.

fix: feat: breaking: <-- major

Re: Conventional Commits: A specification for structured commit messages

#19
I’ve found the commit message guidelines at https://git-scm.com/book/en/v2/Distributed-Git-Contributing-... to very helpful for clarity.

“ The last thing to keep in mind is the commit message. Getting in the habit of creating quality commit messages makes using and collaborating with Git a lot easier. As a general rule, your messages should start with a single line that’s no more than about 50 characters and that describes the changeset concisely, followed by a blank line, followed by a more detailed explanation. The Git project requires that the more detailed explanation include your motivation for the change and contrast its implementation with previous behavior — this is a good guideline to follow. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug."”

Re: Conventional Commits: A specification for structured commit messages

#20
We've been following conventional commits for our front end code for the last year or so at my work. In other repositories, we've loosely followed the keep a change log conventions. I find conventional commits great when your repository will produce a package to be consumed by others. For example, conventional commits for our shared JS code helps us produce great change logs and helps us easily follow semver for the NPM packages our other applications use.

However, I don't find it that useful in the the final applications, even counter productive, since it typically will take up quite a bit of space in the commit title. Many of our front end devs completely ignore title length conventions now.

Post reply on HN