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.

  • Caveman@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    1 year ago

    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”

    • Prison Mike@links.hackliberty.org
      link
      fedilink
      arrow-up
      7
      ·
      1 year ago

      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
      • Caveman@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        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.