1. 23
  1.  

  2. 10

    title should say “GitHub.” the precision is worth three characters.

    1. 2

      Fair point.

    2. 5

      My top requirement for a commit message is that I be able to understand it a month from now.

      1. 2

        Hehe yes that is certainly an important requirement!

      2. 4

        I wonder how many fit the “[This patch] makes xyzzy do frotz” format; that was house style at a previous workplace.

        1. 4

          This article is a good reminder – I had read about the recommended styles for commit messages before, but I need to double down on that again.

          I struggle to make brief and to the point commit messages. It’s always too much like spoken language, and I often end up editing the same commit message or code doc over and over.

          It feels like a waste of time, I wish I could learn to put my precise thoughts in as few words as possible straight away.

          1. 2

            You’re learning and becoming better at it with every edited commit message.

          2. 4

            How many have more than 1 line of commit message?

            1. 4

              From my testing, I did find that there were about 2 million commit messages with only a single present-tense imperative verb, like “Update”, or “Commit”. Also, I did notice a lot of commit messages with multiple lines while testing stuff out, but can’t give you an exact amount at the moment.

              I would answer your question by writing/running a new query, but I racked up about $500 of charges playing with Google BigQuery yesterday, so trying to get that sorted before I run anything else lol…

              1. 5

                Those aren’t necessarily imperative verbs - “update” and “commit” are both perfectly good English deverbal nouns.

                1. 2

                  Haha very true. I guess at that point it comes down to the intent of the developer, which seems impossible to gauge. Imagining a frustrated developer at his wit’s end commanding his computer to “UPDATE!” or “COMMIT!” is amusing though…

            2. 3

              What about performing sentiment analysis on all those commit logs?

              1. 2

                Haha I’d think most commit messages would be a little too dry/robotic to get a good sentiment reading on? What do you think?

                1. 2

                  I’m reminded of once reading about a team that set up their computers to take a webcam snapshot of the developer’s expression (face) when a git conflict occurred.

                  1. 1

                    Well… I was bored the other day which led me to just posting this… https://lobste.rs/s/0zxoap/suggested_improvements_for_tool

                  2. 3

                    Another place where the use of imperative mood makes sense is in option descriptions that you get in --help output for commands. It’s often the shortest form, not only in English but also many other languages. And other forms can be clumsier with regard to whether the command, the option or the human is doing the action. It allows you to leave out the subject of the sentence but still have a valid sentence.

                    1. 2

                      Yes. And this reminds me of a comment from Reddit:

                      “You wouldn’t name a function madeWidget or addedBarToFoo. You’d say make or add. Because you’re not describing what you did. You’re describing what the thing you made does. A commit is a thing you made. Every time someone applies it, it’s going to do something”

                    2. 3

                      Given the free-for-all nature on most Github projects I’m actually very surprised the number you came up with is as high as it is. I would have expected much worse (I’m a strong supporter of following this guideline). If anything there are a lot you might be missing since projects that do have style requirements for commits often also have prefixes (such as Conventional Commits. The most likely projects to stick to mood rules are also the most likely to not make it into these numbers — which just makes the stat even more impressive. Only 45% to go!

                      1. 1

                        Agreed. I touched on the prefixes in my article - I think there is a good chance that they are the biggest source of error in my calculation and would lead to 44% being a low estimate. I may try to add in a regex to account for many of the common prefix formats.

                      2. 2

                        Does anyone think that commit messages using the imperative mood actually have greater value than messages which don’t?

                        1. 3

                          I really just prefer it to be consistent within a repository. Ultimately I end up using the imperative mood in my personal projects because it’s one of the most common, and easiest standards out there to follow.

                          1. 2

                            Yes, I do.

                            The biggest issue is consistency, but imperative mode fits better in more contexts. It usually doesn’t strike people as an important point when writing a commit message, but when reading them in various contexts there is a lower cognitive load when thinking about what a commit does. When cherry-picking commits, sorting through history building change logs, doing pull request reviews, etc. commits written with short first lines beginning with imperative verbs fit best into the largest variety of context.

                            Compare:

                            git apply "I found a fat-finger mistake"
                            git apply "Fix typo in readme"
                            

                            Or:

                            git cherry-pick "Travis makes lots of passes to test the build"
                            git cherry-pick "Reduce passes required by Travis to test build"
                            

                            The first examples doesn’t fit well with the concept of cherry-picking or applying a patch. The first one is pretty easy to guess that the commit fixes the mistake, but in the second example how would you even know whether the commit was increasing passes or decreasing them without the proper verb?

                          2. 2

                            I don’t like using the imperative mood. I prefer to use the present tense as in “[This commit] Adds new feature foo”.