Live data from Hacker News

Conventional Commits: A specification for structured commit messages

conventionalcommits.org

71–80 of 99 posts

Re: Conventional Commits: A specification for structured commit messages

#71
post #66

Earlier quoted context omitted.

Of course not. How else would you do it?

Make a human read the commit history (or tickets) and summarize changes in the language useful for users, not for developers.

Exactly. I can read commit messages myself, but there's a lot of stuff in there that's not relevant to me as a consumer - e.g. refactorings, cleanups, etc.

Re: Conventional Commits: A specification for structured commit messages

#72

Earlier quoted context omitted.

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

I've got an "Unreleased" section in my changelog in which I log any changes that are relevant to consumers, with sections for bug fixes, new features, and breaking changes. No need to clutter my commits with that.

Re: Conventional Commits: A specification for structured commit messages

#74
post #46
post #28

Earlier quoted context omitted.

> the usual 50 character limit. People do this? I guess it's fine if your commits are Personally, almost all my commits follow email styling: first line tries to be concise, newline, then a list of what changes have been made along with a brief justification. Feels like a bare minimum unless you'd rather tie everything into pr's (which can't be seen from command line). This is why for people unfamiliar with git I ref…

You're arguing against a strawman because you misunderstood the parent comment. The character limit was only referring to the subject line. Under it you can have as many lines of additional context as you wish. That's the normal way; the subject is brief, the message is arbitrarily long. For what it's worth, the linux kernel limits it to around 70 chars and uses a subsystem prefix, so clearly that can work on large l…

And some useful context: the 50-character limit is the result of the subject lines then being readable next to a commit graph that Git can display.

Re: Conventional Commits: A specification for structured commit messages

#75
post #61
post #55

Earlier quoted context omitted.

> Why? The machine-readable part is useful for generating changelogs (eg. broken out by type) or implementing semver (eg. detecting breaking changes).

but isn't it an antipattern to generate change-logs from commit subject lines?

That all depends on what you do with the meta-data in the commits. For example, in my work, we analyze the history at the level of merges, not commits, and that works pretty well for us.

Re: Conventional Commits: A specification for structured commit messages

#76
post #61
post #55

Earlier quoted context omitted.

> Why? The machine-readable part is useful for generating changelogs (eg. broken out by type) or implementing semver (eg. detecting breaking changes).

but isn't it an antipattern to generate change-logs from commit subject lines?

That all depends on what you do with the meta-data in the commits. For example, at my work, we analyze the history at the level of merges, not commits, and that works pretty well for us.

Re: Conventional Commits: A specification for structured commit messages

#78
post #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 des…

[deleted]

Re: Conventional Commits: A specification for structured commit messages

#79
post #51

Earlier quoted context omitted.

50 chars seems pretty arbitrary to me. I'd rather have a useful commit message. I've seen some pretty contorted messages conveying no real info in order to meet an imaginary character limit.

the 50 chars is for the subject. the commit message (body) has no character limit (apart from a character limit per line).

Right. But that's the limit I don't get. If I always have to view the expanded set of commit messages to understand anything about the commit, what's the value in a short subject? And why 50 chars? That's even more restrictive than the normal 72/76/80 chars.

Re: Conventional Commits: A specification for structured commit messages

#80
post #76
post #61

Earlier quoted context omitted.

but isn't it an antipattern to generate change-logs from commit subject lines?

That all depends on what you do with the meta-data in the commits. For example, at my work, we analyze the history at the level of merges, not commits, and that works pretty well for us.

Merge information is incredibly useful to developers (even if only to provide a smart "git bisect"). But would you generate a user-visible changelog from your merges? I personally wouldn't, and that's the point GP was making.
Post reply on HN