Git grumpy: Torvalds complains of passive voice in merge commit messages (www.neowin.net)
from AnActOfCreation@programming.dev to programming@programming.dev on 08 Oct 2024 01:05
https://programming.dev/post/20311161

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.

#programming

threaded - newest

mox@lemmy.sdf.org on 08 Oct 2024 01:46 next collapse

I read his message. He didn’t seem grumpy or frustrated to me; just encouraging folks to use a certain style that’s already in wide use, for reduced noise and better consistency.

horse_battery_staple@lemmy.world on 08 Oct 2024 02:09 next collapse

Agreed this is essentially a style guide.

xoggy@programming.dev on 08 Oct 2024 02:11 next collapse

But it’s Linus so everybody likes to think everything he says is blunt and crass.

remotelove@lemmy.ca on 08 Oct 2024 04:52 collapse

Any in many ways, that is the way engineers should speak to other engineers when analyzing a problem.

If two or more people can actually share a common goal of finding the best solution, everyone involved should be making sure that no time is wasted chasing poor solutions. This not only takes the ability to be direct to someone else, but it also requires that you can parse what others are telling you.

If someone makes something personal or takes something personal, they need a break. Go take a short walk or something. (Linus is a different sort of creature though. I get it.)

TBH, this is part of the reason I chose my doctor (GP). She is extremely direct when problem solving and has no problems theory-crafting out loud. Sure, we are social to a degree, but we share many of the same professional mannerisms. (We had a short discussion on that topic the other day, actually. I just made her job easier because I give zero fucks about being judged for any of my personal health issues.)

0x0@programming.dev on 08 Oct 2024 07:24 collapse

You still should use condoms.

remotelove@lemmy.ca on 08 Oct 2024 22:41 collapse

When I see my Dr. or when I talk to other engineers?

0x0@programming.dev on 09 Oct 2024 08:12 collapse

Both, just us’em on your ears when talking to engineers.

otter@lemmy.ca on 08 Oct 2024 02:20 next collapse

The message:

“I try to make my merge commit messages be somewhat “cohesive”, and so I often edit the pull request language to match a more standard layout and language. It’s not a big deal, and often it’s literally just about whitespace so that we don’t have fifteen different indentation models and bullet syntaxes. I generally do it as I read through the text anyway, so it’s not like it makes extra work for me.

But what does make extra work is when some maintainers use passive voice, and then I try to actively rewrite the explanation (or, admittedly, sometimes I just decide I don’t care quite enough about trying to make the messages sound the same).

So I would ask maintainers to please use active voice, and preferably just imperative.”

Giving an example of a bad commit message, Torvalds provided this example: “In this pull request, the Xyzzy driver error handling was fixed to avoid a NULL pointer dereference.” He believes this should have been written as follows: “This fixes a NULL pointer dereference in …”

Hazzard@lemm.ee on 08 Oct 2024 02:49 next collapse

Honestly, makes sense, the active voice version is just… more efficient and easier to parse quickly.

naught@sh.itjust.works on 08 Oct 2024 04:34 next collapse

Weird the example he gave isn’t imperative, which I think would be “Fix a null pointer dereference in …”

undefined@links.hackliberty.org on 08 Oct 2024 05:34 collapse

This is the language I use, once I started I never looked back.

TeoTwawki@lemmy.world on 08 Oct 2024 11:27 next collapse

It’s not a big deal, and often it’s literally just about whitespace so that we don’t have fifteen different indentation models and bullet syntaxes.

Serinus@lemmy.world on 08 Oct 2024 11:58 collapse

Usually just start with the verb.

“fix a NULL pointer dereference in …”

thingsiplay@beehaw.org on 08 Oct 2024 06:35 collapse

“Torvalds complains” makes people click.

dohpaz42@lemmy.world on 08 Oct 2024 01:56 next collapse

Linus Torvalds: creator of Linux and Git, and hero to all English teachers everywhere!

Ephera@lemmy.ml on 08 Oct 2024 11:05 collapse

So, uh, I have a colleague who studied linguistics, and when I explained to her that we write commit messages like that, her reaction was basically: What the fuck, why?

My explanation wasn’t as sharp, as I didn’t call it “imperative” but rather just “infinitive”, which got me the immediate backlash that it’s not a sentence then, so why do you put a dot behind it?

She did accept my descriptivist excuses explanation that we write it that way, because it’s terser, but I know it didn’t sit well with her.
Will need to see what her reaction is to commanding the repo. 😅

SwordInStone@lemmy.world on 09 Oct 2024 10:12 collapse

you put a dot after commit msg?

Ephera@lemmy.ml on 09 Oct 2024 17:43 collapse

Yup. Commit messages are often shown in truncated form, which is when the dot helps to know whether you’re seeing the whole message or not.

Well, and every so often, I’ll use the commit message to document why a change was made, which requires multiple sentences. Then the dot just serves its usual purpose of separating sentences.

starshipwinepineapple@programming.dev on 08 Oct 2024 02:32 next collapse

There are much smaller projects that ask for more from commits/merge messages. This is a normal ask

theherk@lemmy.world on 08 Oct 2024 06:18 next collapse

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.

lysdexic@programming.dev on 08 Oct 2024 06:48 next collapse

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.

theherk@lemmy.world on 08 Oct 2024 07:13 collapse

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.

Serinus@lemmy.world on 08 Oct 2024 12:02 collapse

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

devfuuu@lemmy.world on 08 Oct 2024 11:42 collapse

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

hector@sh.itjust.works on 08 Oct 2024 10:33 next collapse

Linus is a scary man and seems really hard to work with

The fact that Linux blossomed anyways goes to show his talent

TrickDacy@lemmy.world on 08 Oct 2024 10:43 next collapse

People say things like this but he’s probably successfully worked with several hundred more people than your average worker ever will.

MyNameIsRichard@lemmy.ml on 08 Oct 2024 12:01 collapse

Why is he scary?

hector@sh.itjust.works on 08 Oct 2024 12:10 collapse

He said he has trouble feeling empathy and he’s working on it. When this happens he was super mean towards the volunteer work of some contributors who quit the project.

I’m not blaming Linus, I’m just saying I don’t feel like it’s a good atmosphere to work in Linux. It doesn’t feel friendly at all

Thus the scary and stressing quality

MyNameIsRichard@lemmy.ml on 08 Oct 2024 12:55 collapse

That’s not scary. The trick when dealing with that kind of review is to parse out the technical and not take the rest personally, which maybe takes a certain kind of personality.

hector@sh.itjust.works on 08 Oct 2024 13:53 next collapse

Not being a jerk and having empathy are two necessary things to create a healthy work environment and are especially required when volunteers take from their off-time to work on your project.

MyNameIsRichard@lemmy.ml on 08 Oct 2024 13:55 collapse

I agree, but it’s really not scary

derpgon@programming.dev on 08 Oct 2024 15:50 collapse

I do that by default. I have to actively think about empathy when I do CRs, because the other devs (who should not be doing these kinds of mistakes) just can’t fucking do their job right for once.

But when I am getting a review, I don’t get mad unless I am personally attacked (happened with a colleague who had a very high ego and somehow made it to a higher position, finally being let go about half a year back).

cupcakezealot@lemmy.blahaj.zone on 08 Oct 2024 11:42 next collapse

depending on the time of day my commits range from war and peace to 'jfc here is just the message “yeah” for the next twenty commits because the client keeps requesting stupid ass decisions".

NaevaTheRat@vegantheoryclub.org on 08 Oct 2024 21:11 collapse

As the day goes on


fixup=fixup -fuck

fuck

bleh

some bug squashin

implement stuff

Fixes configuration issues, and improves the UI for setting it up

Reptorian@programming.dev on 08 Oct 2024 12:59 next collapse

When I do commit, I write up the title of what I did, and describe it, and then use periods for related commits. Just easier.

Badland9085@lemm.ee on 08 Oct 2024 15:02 next collapse

Love a good commit message. I wish I could say what we perceive as “good” is instead thought to be “normal”, but we aren’t there yet I guess.

If the word “imperative mood” is hard to grasp, this is what I do. I just finish this sentence in less than 50 - 75 words, length depending on consensus.

This commit will …

Add more details in the body if needed.

This sort of style extends to PRs/MRs as well.

This PR/MR will …

AnarchistArtificer@slrpnk.net on 08 Oct 2024 19:44 collapse

That’s actually helpful, thanks

olafurp@lemmy.world on 08 Oct 2024 21:36 next collapse

I like good commit messages that use less words but still give the full picture. If something hacky was done then a comment is better. I like mine with imperative voice since it avoids writing a prose.

“Fix a bug where when doing x then y happens”

“Add setting to control x”

undefined@links.hackliberty.org on 09 Oct 2024 03:29 next collapse

I really don’t like starting with “fix.” You can just describe it without saying “fix” most times.

  • Fix Strings containing whitespace
  • Escape Strings containing whitespace in CSVExporter
leftytighty@slrpnk.net on 09 Oct 2024 14:52 next collapse

I basically stole your comment but made a worse version. On this note, though, there’s sometimes value in using words like “fix” or other kinds of tagging or consistent formatting in the sense that you can do a meta-analysis of the repo history to look at trends (like the ratio of fixes to feature work) over time.

Issue tracking software obviates that, somewhat, but having that info embedded in the repo history lets you go further and look at which files have the most fixes etc.

Existing tools out there sometimes do this exact thing, but it can be manually done as well

olafurp@lemmy.world on 09 Oct 2024 17:07 collapse

I always thought of the “how” being better explained by the code itself where you can see string.replace(" ", "\ ") as the actual fix while the message says the “why”.

I would still have “Fix a bug where strings containing whitespace break CSVExporter” as my go to message.

I guess our viewpoints are different based whether we want the commit messages to represent tasks or changes. They both have their uses of course. Looking at changes to a file to know what people have done to it is better with a “changes” type message but looking at the history to check “did we actually complete this or was it just marked as completed in the issue tracker?” is better with a task based message.

Task management where every issue is put on a ticket and tracked would my type of messages obsolete but at my current company theyre very useful.

leftytighty@slrpnk.net on 09 Oct 2024 14:27 collapse

Knowing you fixed a bug is minimal information and usually covered by an issue reference in professional software development. I’d prefer to see the commit describing what the fix is actually doing to fix the bug.

rolling_resistance@lemmy.world on 09 Oct 2024 20:07 collapse

Right until the reference breaks. Ask me how I know.

NigelFrobisher@aussie.zone on 08 Oct 2024 21:47 next collapse

Real developer’s commit messages are all “Oops”.

groucho@lemmy.sdf.org on 08 Oct 2024 22:15 next collapse

maybe this will work

linting and unit tests

itsnotits@lemmy.world on 09 Oct 2024 03:50 collapse

Real developers’* commit messages

caseyweederman@lemmy.ca on 09 Oct 2024 11:21 collapse

Oh I read it as the singular, as in “a real developer’s ___”

Skates@feddit.nl on 09 Oct 2024 03:26 next collapse

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

Things To Care About, vol 147, 2nd edition

mindaika@lemmy.dbzer0.com on 09 Oct 2024 14:51 next collapse

Updates & fixes -> I personally made updates with my bare hands and then also actively fixed some broken things also with my bare hands

thann@lemmy.dbzer0.com on 09 Oct 2024 16:27 next collapse

You head him boys! Users of passive voice should be puched in the face!

ByteOnBikes@slrpnk.net on 09 Oct 2024 20:20 collapse

Hey, I was wondering if you can update your commit with a punch in the face, if possible? No pressure thanks for contributing!

Gallardo994@sh.itjust.works on 09 Oct 2024 21:35 next collapse

Upd

Fix

Upd

Fuck

Updated file1

Fuck

Fix

Updated file2

Merge remote-tracking branch other-user1-feature

Fix after merge

Upd

Revert “Merge remote-tracking branch other-user1-feature”

Revert “Revert “Merge remote-tracking branch other-user1-feature””

onlinepersona@programming.dev on 12 Oct 2024 06:34 collapse

You know, if they used the PR workflow with a CI that enforced standardised commit messages, this could be quite easily solved? Forcing everything through a mailing list seems to create more work for maintainers…

Anti Commercial-AI license