A little formating aid for commit messages

Israel Chauca March 5, 2012

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

2 answers

1 accepted

2 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 5, 2012

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 September 11, 2013

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.

Eric Nielsen April 16, 2017

I see https://jira.atlassian.com/browse/SRCTREE-480 is marked as resolved, but I yet don't see this feature on SourceTree (I'm using version 2.5 (104) for Mac).

GitUp provides such feature, and that's the only reason I'm still using it or Vim to edit my commit messages...  :- )

Screenshot from GitUp commit message field:

 Screen Shot 2017-04-16 at 6.00.17 PM.png

0 votes
Martin Geisler September 11, 2013

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events