top | item 8874177

Atom – Git commit messages

86 points| selvan | 11 years ago |atom.io | reply

54 comments

order
[+] krat0sprakhar|11 years ago|reply
Cool fun idea - I dont understand though whats the reasoning behind using the present tense.

$ git commit -m "Add email integration on /email route" sounds weird for an activity that has been completed.

[+] vertex-four|11 years ago|reply
It's a standard to use the imperative mood in writing commit messages - the Linux kernel enforces this[0], as do a lot of other projects.

It makes more sense if you consider a commit to be an independent "thing" in a list, and you follow the list from start to finish to end up with the current repository state, each commit being a command.

[0] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.g...

[+] diggan|11 years ago|reply
Because generally you're reading commits that happened before and you want to know what happens when you apply the commit.

It goes something like this.

"Hmm, I wonder what would happen if I merge 1231knf?"

It would "Add email integration on /email route"

Otherwise it would be something like

"What happens when I merge this commit?"

"Added email integration on /email route"

It's considered as best practice when using Git to write in present tense.

[+] kasbah|11 years ago|reply
I tend to use that style because it matches git's generated commits ("Merge ...") and it saves a few characters. I found that when using a different tense ("Adding" or "Added") I would run out of characters more often.
[+] icefox|11 years ago|reply
I thought it was very meta amusing that the author was trying to tell users how to write commit messages when the number one rule of commit messages in my book is explaining WHY the commit exists. Why does this patch change this or do that. So it was amusing when he lists commit rules without explaining why they are rules. But I was saddened when I got to the end and missing from the list is 'explain why'.

Why did you 'Add feature...'? Why did you 'Move cursor to...'?

I did stuff // Increment i by 1

Why I did stuff // Increment i by 1 to not have a off by 1 bug

[+] bsimpson|11 years ago|reply
Angular has similar rules.

Maybe it's because "Add" is shorter than "Adding" or "Added"? When I first worked on a project that followed the Angular pattern, the guy ramping me up said "Just imagine that you're commanding the computer to do something, and use that tense."

[+] Artemis2|11 years ago|reply
The past sounds good, until recently I was writing my commit messages using it, but when you start making pull requests on GitHub, you realize that it makes a lot more sense in general to use present for the titles of your commits.

A commit can be seen as a patch, which has a single purpose: "Add...".

[+] mponw|11 years ago|reply
"/email route: Email integration added" is my favorite way. Same thing with code naming, I always put the widest context first, then narrow down. With this habit I spend a lot less time thinking about names.
[+] Igglyboo|11 years ago|reply
Say you want to apply a certain commit to your branch, it makes more sense to "add" a feature than to "added" a feature.

What does a commit do? It adds/fixes/breaks, it doesn't added/fixed/broke.

[+] mrcwinn|11 years ago|reply
I'm sure this isn't real or just a fun joke. Please don't consider using a :checkered_flag: emoji to indicate you are fixing something on Windows, or any of these other icons.

Or:

Please consider using these emoji, but please don't anticipate or expect other developers will have any idea what their usage means.

[+] Navarr|11 years ago|reply
Well, this is specifically for contributing to Atom - and if you look at their commit messages it looks like they're at least somewhat doing just that.
[+] leejo|11 years ago|reply
> Please consider using these emoji

Fine with that, but please also write longer descriptive commit messages. For example:

  > git log -1 3b5bb1501ce7af8f857af7621fc0d5f86fb4fa93

  commit 3b5bb1501ce7af8f857af7621fc0d5f86fb4fa93
  Author: Ben Ogle <[email protected]>
  Date:   Tue Jan 6 17:09:59 2015 -0800

     :lipstick:

Tells me nothing. Nothing! At a glance the commit messages for the atom repo are poor:

  atom > git-mean-commit-message-bytes | grep '>'
  >ALL 147
You would hope github and git users would grok the power of git's commit messages, but hey ho...
[+] rplnt|11 years ago|reply
Are those emoji an attempt at vendor lock-in? Want to contribute to our project? Use our version of git. I hope this doesn't spread elsewhere.

I'd accept showing icons when certain commit/commit message criteria are met, for example "refactoring" in commit message or perhaps whitespace commit would trigger the lipstick icon. But putting :lipstick: as the first word in your commit message? What user davexunit said.

[+] laurent123456|11 years ago|reply
Aren't these standard? There's the beer icon showing up when using Homebrew on OSX, I guess the other ones would show up too on a `git log`.
[+] raju|11 years ago|reply
I came across the "tags" that the AngularJS uses, and have found these to be a lot more relevant to my projects. I agree with @mrcwinn that expecting other developers to understand the usage of some of these is asking too much (`:lipstick:` ??? ).

https://github.com/angular/angular.js/blob/master/validate-c...

The format they enforce is here - https://github.com/angular/angular.js/blob/master/validate-c...

If done right then these tags can be invaluable when using tools like `git-bisect` - you can safely ignore the ones marked `docs` or `style` (assuming you are not working with a language like Python).

Not to mention you can build automation around like, for e.g. automatically generating release notes.

[+] kmfrk|11 years ago|reply
The lipstick one seems pretty silly - especially if one is familiar with the idiom "lipstick on a pig".
[+] unhammer|11 years ago|reply
They contradict themselves. Should it be present ("Is/are less buggy") or imperative ("Be less buggy")?
[+] Artemis2|11 years ago|reply
Imperative present. These are compatible. Writing a commit also implies the use of verbs related to actions.
[+] bhhaskin|11 years ago|reply
I have been using atom sense its initial beta release and it has come quite a long way. Some of these contribution guidelines might seem silly (such as the emoji) but it definitely works for the community.
[+] re1ser|11 years ago|reply
Did they improved startup time of the editor? Last time I tested it (Windows 7 x64bit) it took good 3-5 seconds for it to start.
[+] AdmiralAsshat|11 years ago|reply
Do Android-centered commits use the Linux emoji, or should we be lobbying for a mobile-device emoji?
[+] davexunit|11 years ago|reply
>Use the present tense ("Add feature" not "Added feature")

Agreed.

>Use the imperative mood ("Move cursor to..." not "Moves cursor to...")

Agreed.

>Limit the first line to 72 characters or less

Agreed.

>Reference issues and pull requests liberally

Agreed.

>Consider starting the commit message with an applicable emoji

Fuck off. This is completely useless and doesn't deserve 14 examples when the above sensible directions are so brief.

[+] k2xl|11 years ago|reply
"Fuck off" - seriously? Why use such inflammatory language in your post. A simple "Disagree" would have sufficed.

IMHO the tags are a quick way to filter commits by each of those. The images are just for quicker reference.

[+] eterm|11 years ago|reply
It's their project, if you want to contribute why not follow their guidelines?

The emojii are just shorthands for [CodeImprovement], [Feature], or whatever you might otherwise tag commits as.

[+] tw04|11 years ago|reply
So... emoji, but still horrible performance? Moving on...

Really? Downvotes without a response? Seems awfully cowardly. So I'll just assume the performance has improved to the point that opening a large file doesn't cause it to lockup for an hour? Because that seems a lot more important to me than emoji's for commits...

*nope, just tried it again, performance still blows.

[+] andyhmltn|11 years ago|reply
The downvotes were (I assume) because you are going completely off-topic. This isn't about performance of the Atom application, it's about their commit guidelines for contributing to the project.

Editing your comments to attack people that downvoted you is only going to make the situation worse. Just face the fact that it probably wasn't a good comment and move on.