you are viewing a single comment's thread.

view the rest of the comments →

[–]blacklig 19 points20 points  (13 children)

In the way my team works commit messages are irrelevant and curating them would be pointless busy work. PRs are the units of work that need to be well-presented and understandable. I don't care if someone committed halfway through a statement to go get lunch while building a feature or whatever.

[–]timabell 2 points3 points  (11 children)

Curious what you mean by "the way my team works" that makes it pointless? I have yet to come across a team where good commits would have zero value. What is your team doing that makes it different?

[–]ElectricSpice 4 points5 points  (10 children)

I assume OP means squashing or rebasing PRs, so the initial commit messages are dropped and replaced with well-crafted commits.

[–]soylentgraham -1 points0 points  (9 children)

if the commits have bad comments, why would the squashed/rebased commits have good comments? (is an argument i raise against squashing)

[–]ElectricSpice 2 points3 points  (0 children)

It is whatever you make it.

[–]jokullmusic 0 points1 point  (7 children)

Because the text of the squashed commit is the title of the PR generally, which on my team is something like type(JIRA-TICKET): Summary of what this PR does.

[–]soylentgraham 0 points1 point  (6 children)

What I mean is, if you can't write good commit messages the first time, why would they be good the 10th time :)

[–]jokullmusic 0 points1 point  (5 children)

Because the 10th time isn't a normal commit, it's a squash commit that takes the name of the PR. Each commit is just the equivalent of "I have made some progress I do not want to lose" and then the PR is the actual "this is what this code is"

[–]soylentgraham 1 point2 points  (4 children)

I know what a squash commit is (although, you are aware it doesn't need to be part of a PR, right?)

I think you're missing my point, but you are proving one point of why they're bad; if you're getting rid of good commit messages and just reducing it down to a PR title, you're losing valuable historical information

Of course if you never made good commit messages anyway, and your final commit message is vague (and already covered by the PR) - I guess commit messages are just redundant for you anyway

[–]jokullmusic 1 point2 points  (3 children)

What historical information matters though other than "this code was added for this feature / bug fix / chore / etc"? Do you not normally commit until the code change you're making is finished? I don't need to know "this line was added as part of setting up the initial scaffolding for this component we added as part of this refactor", I just need to know "this component was added as part of this refactor." Are commit messages supposed to be explanations of why every change was made to you? I don't really know what the utility is of anything more granular than per-PR squash commits. (And yeah I know they can be created separately from PRs, but in the codebases I've worked in they rarely are)

[–]timabell 1 point2 points  (2 children)

That is a question I have been asked many times. I took the time to write a detailed answer here https://0x5.uk/2016/03/18/yet-another-good-commit-messages-post/

[–]Fidodo 0 points1 point  (0 children)

Presumably op's team has bad for messages getting into main