Bug 337401 - Improve egit commit message populated by mylyn
Summary: Improve egit commit message populated by mylyn
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Mylyn (show other bugs)
Version: 0.11   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-17 04:17 EST by Alex Blewitt CLA
Modified: 2012-06-26 14:52 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2011-02-17 04:17:01 EST
Git commit messages have a particular format and style which Mylyn currently ignores. 

The first line is a < 50 char imperative description of the change. This may correlate well to the title of a task in mylyn; though may require rewording. It should not end in punctuation. 

The second line is blank. 

The third (and subsequent) lines are flowed to 72 characters max. Paragraphs are permitted/encouraged with a blank line between. 

The final paragraph is a set of newline separated Key: Value pairs, which will include e.g. 

Change-Id: I12345
Signed-off-by: A N Other <a.n.other@example.org>

Mylyn should not put (a) the state of the task or (b) the bug id in the first line. It should simply be the task's title; and users can then create tasks in the imperative style. 

The bug should be recorded in the key: value paragraph as follows:

Bug: 12345

It may be advantageous to permit the URL to be included bit this should be a configurable option on a per-project or workspace setting:

Bug: http://bugs.eclipse.org/12345
 
See e.g. http://365git.tumblr.com/post/3308646748/writing-git-commit-messages and git's submitting patches guidlines at http://git.kernel.org/?p=git/git.git;a=blob;f=Documentation/SubmittingPatches;h=ece3c77482b3ff006b973f1ed90b708e26556862;hb=HEAD for more details.
Comment 1 Alex Blewitt CLA 2011-02-17 04:33:40 EST
Incidentally the 50 char and 72 char limits aren't purely stylistic. When running "git log --oneline" the default format has a 6-digit commit id, followed by a space, followed by the first line of the commit message. A 72-char commit message will thus fit; but if there are merge nodes shown then there may be two or more branch lines and a space as well. 

In a long git log, the remainder of the body is shown with an 8-space indent, so a 72 max line will result in an exact fit 80 chars, which is the default terminal width.