this post was submitted on 08 Oct 2024
186 points (91.5% liked)

Programming

17398 readers
99 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

Linus Torvalds expressed frustration over the use of passive voice in merge commit messages, preferring active and imperative language instead.

He provided an example of how commit messages should be rewritten for clarity and consistency across the project.

Torvalds noted that while it's not a major issue, it does add extra work when he has to rewrite messages to match his preference.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 46 points 1 month ago* (last edited 1 month ago) (2 children)

And here it is in the kernel contribution documentation.

Simple example:

  • bad: ~~Added foo interface.~~
  • good: Add foo interface.

So the commit says what applying the patch will do, not what you worked on.

[–] [email protected] 16 points 1 month ago (1 children)

good: Add foo interface.

Another commit style is summarizing what a commit does. In this case it would be someting like:

Adds foo interface.

I think this style is more in line with auditing code.

[–] [email protected] 9 points 1 month ago (1 children)

This indicative mood is something I would send back for correction or correct myself where I am the maintainer. However I understand that although this is pretty consistent through FOSS, it is not a settled matter especially in corpo-land. Most important is that it is consistent within a project. See many differing views here on Stackoverflow, noting the most popular answer though is imperative as Linus requests.

[–] [email protected] 4 points 1 month ago

Honestly I've never thought about it this much. I'll have to make an effort to stop writing in past tense.

[–] [email protected] 16 points 1 month ago

This has been the recommendation and the way to do it for decades everywhere I've been too.