-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
None
I like beautiful commit messages. Most people using git like it too, and what consists a beautiful message has been nicely summarized by Tim Pope here:
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
And while this is about git, mercurial repositories would probably benefit from the same conventions.
So, I'd love if SourceTree could help me writing those messages. For example, it could render the first line of the message in bold, and somehow signal if I go over 50 characters for that line. For the rest of the commit message, it should automatically insert line breaks at 72 characters, inserting spaces for indentations when it looks like I'm typing a bullet list.
Another option would be embedding Emacs as the commit message editor (I'm half joking about this).
- is duplicated by
-
SRCTREE-2606 Support "50/72" git commit format
- Closed
-
SRCTREE-2700 Formatting of git commit message
- Closed
-
SRCTREEWIN-161 Commit message formatting
- Closed
- is related to
-
SRCTREE-4522 Add a symbol counter for commit message
- Closed
-
SRCTREE-1650 Column character count when fixed-width pref set for commit message input
- Closed
-
SRCTREE-2134 Show the character line count in the commit editor
- Closed
Form Name |
---|
Well, that's not entirely correct. Please check out what git help commit says:
So the first line of a commit message is special and git will treat it differently in some cases. E.g. check out git help log and go to the PRETTY FORMATS section. Depending on what format you choose, only the first line is displayed by git as this line is considered to be the title of the commit message.
It is just a recommendation, that's true, you are free to ignore it, but it is a recommendation from the developers of git and ignoring it will have negative consequences, e.g. wrong log output or git-format-patch working not as expected or desired. The majority of UI clients and web services that I know stick to that recommendation, github will even warn you when your first line goes beyond the 50 character limit. That's because a lot of tools will by default shorten commit messages in the UI to the first line and this line is then again shorten to 50 characters, if it is longer. If the first 50 characters are no meaningful commit messages, users of these apps will have a hard time browsing through the history as they need to open the detail view for every commit to find out what this commit is really all about.
The 72 character limit on the other hand is nothing that git itself ever mentions, that's just to prevent ugly line breaking in the middle of words if you have a 80 character terminal. And to me it does not sound very meaningful to limit my commit messages to a specific length just because git is too stupid to break on word boundaries. Every other UI tool will do that just fine. Also there is no guarantee that there are no ugly breaks just because I stay below 72 characters as terminals don't have to be 80 characters and when displaying the history in a terminal that is below 72 characters, the ugly line breaks will return. Actually in that case, the limitation to 72 chars leads to even more ugly line breaks than no limitation at all would have, as now there is an ugly break anywhere within the line following a very short line with a manual break and that is even more unpleasing to the eye and even harder to read.