Find Questions…

Close ×
First time here? Check out the FAQ!

A little formating aid for commit messages

Raimondi asked this question · 51 karma ·

While I really like SourceTree and it's the first app of its kind that I continue using (I've tried all the others but for some reason or another I dropped them), I really miss how Vim helps with following some important guidelines for commit messages [1][2][3].

On the first line the 50 first chars are highlighted with one color, any char after the 50th column is highlighted in a different one to help you know that it's too long. I tend to write long commit messages, so this is a big help for me.

If you write something on the second line the text is highlighted in a very visible manner (bold orange here). This is not really a big need if you know the guidelines, but it's be nice to have.

From the third line on, the text is automatically wrapped at 72 chars, but I guess a different highlighting similar to the one in the first line would be fine.

Mercurial has a similar guideline for changeset comments [4], so a feature like this would benefit more than just Git users.

I'm not suggesting that you implement exactly the same behaviour that Vim provides, but it would be really nice to have some kind of help on this area.

Cheers!

----

[1] http://schacon.github.com/git/user-manual.html#creating-good-commit-messages

[2] http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

[3] http://gitref.org/basic/#commit

[4] http://mercurial.selenic.com/wiki/ChangeSetComments

1489 views

One Answer:

Steve Streeting [Atlassian] · 14,675 karma ·

I have a wishlist item for templates in commit messages, thanks for the examples. https://jira.atlassian.com/browse/SRCTREE-480

I'll be honest - it hasn't really risen to the top of my list yet. It's probably because I've never felt that adhering to strict commit message structures in any project I've led or been involved in for the last 20 years has been that important, it's the content that matters IMO. I've run large open source projects and not felt this is an issue. I think these sorts of guidelines are only an issue for pure command-line users, or maybe those who post-process their logs into something other than HTML (I've auto-generated changelogs for years without having to adhere to 72 chars). But I accept that some people like a more rigid structure, it's why the commit message box has the option to use fixed-width fonts. So I may well add this in the future.

Martin Geisler · 1,526 karma ·

Repository browsers like TortoiseHg and hgweb show the commit messages as they were entered: long lines are not wrapped and will cause a scroll-bar to be displayed. So please make sure that it's easy to hard-wrap commit messages in SourceTree. Otherwise it cannot really be used together with other repository browsers.

Looking for something else?

Find Questions…

or Browse other questions tagged:

or Ask a Question