create account

Writing efficient commit messages; software projects, and Utopian by emrebeyler

View this thread on: hive.blogpeakd.comecency.com
· @emrebeyler · (edited)
$58.62
Writing efficient commit messages; software projects, and Utopian
At Utopian, we have a different kind of metrics to score a contribution. One of them is about commit messages. And I generally have to score low or average on that question.

<center>![Screen Shot 2018-08-29 at 11.16.33.png](https://ipfs.busy.org/ipfs/QmduYjpCzCZdiPFcZykZVLedRMX9ud5i9HzVaj2K6w3JHb)</center>
***

#### Why developers should write good commit messages?
***

- It will help other developers to understand what's happened inside the change set for each commit.
- It will help to speed up the code reviewing process. (This also applies to Utopian moderator reviews.)
- It will help internal teams (generally project management side.) to create changelogs, announcements on new iterations. Everyone can read and understand a text, but, not everyone can read and understand the change set in the source code.


#### What is a good commit message, anyway?
****

The creator of GIT and Linux, Linus Torvalds [describes a good commit message](https://github.com/torvalds/subsurface-for-dirk/blob/a48494d2fbed58c751e9b7e8fbff88582f9b2d02/README#L88) like this:

```
    Header line: explain the commit in one line (use the imperative)

    Body of commit message is a few lines of text, explaining things
    in more detail, possibly giving some background about the issue
    being fixed, etc etc.

    The body of the commit message can be several paragraphs, and
    please do proper word-wrap and keep columns shorter than about
    74 characters or so. That way "git log" will show things
    nicely even when it's indented.

    Make sure you explain your solution and why you're doing what you're
    doing, as opposed to describing what you're doing. Reviewers and your
    future self can read the patch, but might not understand why a
    particular solution was implemented.

    Reported-by: whoever-reported-it
    Signed-off-by: Your Name <youremail@yourhost.com>

where that header line really should be meaningful, and really should be
just one line.  That header line is what is shown by tools like gitk and
shortlog, and should summarize the change in one readable line of text,
independently of the longer explanation. Please use verbs in the
imperative in the commit message, as in "Fix bug that...", "Add
file/feature ...", or "Make Subsurface..."
```

At the end of the day, it's not very complicated. Just make sure you have a simple one-liner header, and a  descriptive summary about the changes.

Also, using imperative mood is something I have been wanting to see in commit messages. It's also mentioned git's [original repository](https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/SubmittingPatches?id=HEAD#n133)

```
[[imperative-mood]]
Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
to do frotz", as if you are giving orders to the codebase to change
its behavior. 
```

#### Some bad examples
****

<center><img src="https://imgs.xkcd.com/comics/git_commit.png"></center>
<center>[git commit](https://xkcd.com/1296/) on [xkcd.com](https://xkcd.com)</center>
***

Oh, there are so many of [them](https://github.com/search?q=fuck&type=Commits). A [search query with **damn**](https://github.com/search?q=fuck&type=Commits) on commit messages at Github, results with 642,505 commits. Unbelievable, right?

#### Utopian reviews
***

We don't want to bother developers with details, however, we want to see git logs clean, understandable. That's why we have a separated question about this on our review questionnaire.

If you care about this, not only you will get better review scores, you will also have better git logs which will help other contributors to work on your project.

Happy coding!
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 166 others
👎  
properties (23)
authoremrebeyler
permlinkwriting-efficient-commit-messages-software-projects-and-utopian
categorygit
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["git","utopian-io","iamutopian","blog","busy"],"users":["yourhost.com"],"links":["https://github.com/torvalds/subsurface-for-dirk/blob/a48494d2fbed58c751e9b7e8fbff88582f9b2d02/README#L88","https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/SubmittingPatches?id=HEAD#n133","https://xkcd.com/1296/","https://xkcd.com","https://github.com/search?q=fuck&type=Commits","https://github.com/search?q=fuck&type=Commits"],"image":["https://ipfs.busy.org/ipfs/QmduYjpCzCZdiPFcZykZVLedRMX9ud5i9HzVaj2K6w3JHb","https://imgs.xkcd.com/comics/git_commit.png"]}
created2018-08-29 08:50:09
last_update2018-08-29 13:04:12
depth0
children11
last_payout2018-09-05 08:50:09
cashout_time1969-12-31 23:59:59
total_payout_value46.114 HBD
curator_payout_value12.508 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,732
author_reputation448,528,959,341,273
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,681,976
net_rshares38,881,100,869,633
author_curate_reward""
vote details (231)
@didic ·
$1.60
It's an honor to moderate the first #iamutopian post. We don't really have an appropriate scoring format for these posts, of course, as they are a new and unique thing we're doing. Therefore, the score won't be reflective of the post's quality.

This is a very useful post, and one that I hope future contributors to your category will read and refer to. 

I do have a couple of comments, because I always have a couple of comments. 

On the style and grammar side, the post is generally quite good, but there are small issues. 

For instance, "we have different kind of metrics" should be "we have ***a*** different kind of metrics"

"speed-up code reviewing process" should be "speed up ***the*** code reviewing process." Note that I removed the hyphen from "speed up" as well.

On the content side, I would have loved to have seen your own explanation of what makes a good commit message, not the one Linus wrote. I would have also liked "some bad examples" to include some actual bad examples. 

Thank you for your contribution and for being the first to brave the waters of #iamutopian. 

Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/1/22444314).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
👍  , , , , , , ,
properties (23)
authordidic
permlinkre-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180829t123502864z
categorygit
json_metadata{"tags":["git","iamutopian"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/1/22444314","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-08-29 12:35:03
last_update2018-08-29 12:35:03
depth1
children3
last_payout2018-09-05 12:35:03
cashout_time1969-12-31 23:59:59
total_payout_value1.237 HBD
curator_payout_value0.366 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,584
author_reputation76,371,161,336,613
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,696,874
net_rshares1,062,764,731,268
author_curate_reward""
vote details (8)
@ecoman1 ·
i hpe in the chage life .........
properties (22)
authorecoman1
permlinkre-didic-re-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180907t033819913z
categorygit
json_metadata{"tags":["git"],"app":"steemit/0.1"}
created2018-09-07 03:38:24
last_update2018-09-07 03:38:24
depth2
children0
last_payout2018-09-14 03:38:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length33
author_reputation3,594,222,183
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id70,566,783
net_rshares0
@emrebeyler · (edited)
Thank you for the review and great feedback.
properties (22)
authoremrebeyler
permlinkre-didic-re-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180829t130641314z
categorygit
json_metadata{"tags":["git"],"app":"steemit/0.1"}
created2018-08-29 13:06:42
last_update2018-08-29 13:07:03
depth2
children0
last_payout2018-09-05 13:06:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length44
author_reputation448,528,959,341,273
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,699,262
net_rshares0
@utopian-io ·
Thank you for your review, @didic!

So far this week you've reviewed 15 contributions. Keep up the good work!
properties (22)
authorutopian-io
permlinkre-re-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180829t123502864z-20180830t024009z
categorygit
json_metadata"{"app": "beem/0.19.42"}"
created2018-08-30 02:40:09
last_update2018-08-30 02:40:09
depth2
children0
last_payout2018-09-06 02:40:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length109
author_reputation152,955,367,999,756
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,754,358
net_rshares0
@jrswab ·
**Thanks for this!**

I was always under the impression that commit messages needed to be short and to the point. However, now that you shared what Linus said about them I won't be afraid to write more after the one line at the start.

![i-appreciate-you](https://media.giphy.com/media/kiLq8SSDcewve/giphy.gif)

<3 *J. R.*
properties (22)
authorjrswab
permlinkre-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180829t131623669z
categorygit
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["git"],"users":[],"links":[],"image":["https://media.giphy.com/media/kiLq8SSDcewve/giphy.gif"]}
created2018-08-29 13:16:24
last_update2018-08-29 13:16:24
depth1
children0
last_payout2018-09-05 13:16:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length322
author_reputation46,062,246,679,771
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,700,052
net_rshares0
@mactro ·
I would also add, that it's good to have task/issue number (if it exists), first in the commit header, like `ASD-123 Fix main window not being displayed`. That way you can quickly see which commits are related to each other in git log.
properties (22)
authormactro
permlinkre-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180831t054537205z
categorygit
json_metadata{"tags":["git"],"app":"steemit/0.1"}
created2018-08-31 05:45:36
last_update2018-08-31 05:45:36
depth1
children1
last_payout2018-09-07 05:45:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length235
author_reputation865,272,238,829
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,862,121
net_rshares0
@emrebeyler ·
Good point. We practice this also in our workflow at the company.
properties (22)
authoremrebeyler
permlinkre-mactro-re-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180831t083357352z
categorygit
json_metadata{"tags":["git"],"app":"steemit/0.1"}
created2018-08-31 08:33:57
last_update2018-08-31 08:33:57
depth2
children0
last_payout2018-09-07 08:33:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length65
author_reputation448,528,959,341,273
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,872,589
net_rshares0
@ms10398 ·
Yeah usually for projects I usually prefer [commitlint](https://github.com/marionebl/commitlint) to add in git precommit hook so that commit cannot be made without proper commit convention.
👍  
properties (23)
authorms10398
permlinkre-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180829t114643247z
categorygit
json_metadata{"tags":["git"],"links":["https://github.com/marionebl/commitlint"],"app":"steemit/0.1"}
created2018-08-29 11:46:42
last_update2018-08-29 11:46:42
depth1
children1
last_payout2018-09-05 11:46:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length189
author_reputation27,572,487,973,390
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,693,616
net_rshares1,228,606,054
author_curate_reward""
vote details (1)
@emrebeyler ·
commitlint looks awesome.
properties (22)
authoremrebeyler
permlinkre-ms10398-re-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180829t130528969z
categorygit
json_metadata{"tags":["git"],"app":"steemit/0.1"}
created2018-08-29 13:05:30
last_update2018-08-29 13:05:30
depth2
children0
last_payout2018-09-05 13:05:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length25
author_reputation448,528,959,341,273
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id69,699,172
net_rshares0
@nothingismagick ·
Thanks for the clear write-up. I have something that I would LOVE to discuss with you about Utopian and git commits. Maybe we could meet up on #VIPO ?
properties (22)
authornothingismagick
permlinkre-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180902t204059108z
categorygit
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["git"],"users":[],"links":["/trending/vipo"],"image":[]}
created2018-09-02 20:41:00
last_update2018-09-02 20:41:00
depth1
children0
last_payout2018-09-09 20:41:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length150
author_reputation4,247,535,102,225
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id70,124,737
net_rshares0
@princessdharmy ·
Thanks so much for the enlightenment. Honestly, I would say I'm one of those that write bad commit messages because I never knew the usefulness until I joined utopian which I couldn't escape it and I improved a bit. 

Please, I would still like to know more on writing good commit messages because the samples you gave here aren't clear enough for me.  Thanks.
properties (22)
authorprincessdharmy
permlinkre-emrebeyler-writing-efficient-commit-messages-software-projects-and-utopian-20180903t110727682z
categorygit
json_metadata{"tags":["git"],"app":"steemit/0.1"}
created2018-09-03 11:07:33
last_update2018-09-03 11:07:33
depth1
children0
last_payout2018-09-10 11:07:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length360
author_reputation3,142,320,977,108
root_title"Writing efficient commit messages; software projects, and Utopian"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id70,174,634
net_rshares0