-
Notifications
You must be signed in to change notification settings - Fork 594
README.md: adding a git style guide #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
On Wed, Sep 09, 2015 at 03:55:36PM -0700, Vincent Batts wrote:
Maybe link there for folks who want more detail on or the motivation |
README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
50 seems overly strict, especially if we want a prefix. Looking through our 1113 non-merge commits (with --format=%s) we only have 62% ≤50 chars, and but 78% are ≤ 70 chars. Of course some of those are because folks forgot the blank-line after the summary. But I still think a larger limit here would help encourage more explicit summaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is actually from git-commit(1) own guidelines. https://www.kernel.org/pub/software/scm/git/docs/git-commit.html
Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line and then a more thorough description. The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Sep 09, 2015 at 04:12:24PM -0700, Vincent Batts wrote:
+2. Limit the subject line to 50 characters
this is actually from
git-commit(1)own guidelines.
Then I think everyone is just blindly copying it around ;). Looking
at the git.git history through v2.3.4 (git log --no-merges --format=%s
v2.3.4), we have 29853 commits, with 56% ≤ 50 chars and 94% ≤ 70
chars.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And because it's been too long since I've busted out some Matplotlib, here's a histogram for git.git:
Generated with:
import sys
import matplotlib.pyplot
lines = sys.stdin.read().splitlines()
lengths = [len(line) for line in lines]
figure = matplotlib.pyplot.figure()
axes = figure.add_subplot(1, 1, 1)
axes.hist(lengths, 50)
axes.set_xlabel('commit message length (chars)')
axes.set_ylabel('counts in git.git through v2.3.4')
figure.savefig('x.png');).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jesus Trevor... I ....
On Sep 9, 2015 19:37, "W. Trevor King" [email protected] wrote:
In README.md
#168 (comment):@@ -167,4 +169,16 @@ using your real name (sorry, no pseudonyms or anonymous contributions.)
You can add the sign off when creating the git commit via
git commit -s.+### Commit Style
+
+Simple house-keeping for clean git history.
+
+1. Separate subject from body with a blank line
+2. Limit the subject line to 50 charactersAnd because it's been too long since I've busted out some Matplotlib,
here's a histogram for git.git:[image: x]
https://cloud.githubusercontent.com/assets/209920/9776781/d9e8bb6a-5710-11e5-9fd1-a7b62e54b677.pngGenerated with:
import sysimport matplotlib.pyplot
lines = sys.stdin.read().splitlines()
lengths = [len(line) for line in lines]
figure = matplotlib.pyplot.figure()
axes = figure.add_subplot(1, 1, 1)
axes.hist(lengths, 50)
axes.set_xlabel('commit message length (chars)')
axes.set_ylabel('counts in git.git through v2.3.4')
figure.savefig('x.png');).
—
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/168/files#r39110526.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless of the past commits, this would obviously be for future commits.
On Sep 9, 2015 19:38, "Vincent Batts" [email protected] wrote:
Jesus Trevor... I ....
On Sep 9, 2015 19:37, "W. Trevor King" [email protected] wrote:In README.md
#168 (comment):@@ -167,4 +169,16 @@ using your real name (sorry, no pseudonyms or anonymous contributions.)
You can add the sign off when creating the git commit via
git commit -s.+### Commit Style
+
+Simple house-keeping for clean git history.
+
+1. Separate subject from body with a blank line
+2. Limit the subject line to 50 charactersAnd because it's been too long since I've busted out some Matplotlib,
here's a histogram for git.git:[image: x]
https://cloud.githubusercontent.com/assets/209920/9776781/d9e8bb6a-5710-11e5-9fd1-a7b62e54b677.pngGenerated with:
import sysimport matplotlib.pyplot
lines = sys.stdin.read().splitlines()
lengths = [len(line) for line in lines]
figure = matplotlib.pyplot.figure()
axes = figure.add_subplot(1, 1, 1)
axes.hist(lengths, 50)
axes.set_xlabel('commit message length (chars)')
axes.set_ylabel('counts in git.git through v2.3.4')
figure.savefig('x.png');).
—
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/168/files#r39110526.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Sep 09, 2015 at 04:38:49PM -0700, Vincent Batts wrote:
+2. Limit the subject line to 50 characters
Jesus Trevor... I ....
Graphs help people make decisions, right? ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or help give graphics for a slide deck...
On Sep 9, 2015 19:42, "W. Trevor King" [email protected] wrote:
In README.md
#168 (comment):@@ -167,4 +169,16 @@ using your real name (sorry, no pseudonyms or anonymous contributions.)
You can add the sign off when creating the git commit via
git commit -s.+### Commit Style
+
+Simple house-keeping for clean git history.
+
+1. Separate subject from body with a blank line
+2. Limit the subject line to 50 charactersOn Wed, Sep 09, 2015 at 04:38:49PM -0700, Vincent Batts wrote: > +2. Limit
the subject line to 50 characters Jesus Trevor... I ....
Graphs help people make decisions, right? ;)—
Reply to this email directly or view it on GitHub
https://github.com/opencontainers/specs/pull/168/files#r39110896.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Wed, Sep 09, 2015 at 04:41:54PM -0700, Vincent Batts wrote:
+2. Limit the subject line to 50 characters
Regardless of the past commits, this would obviously be for future
commits.
This limit has been part of the Git docs for a while now, and they're
still not keeping under 50 (they also reference the 50-char soft limit
in Documentation/SubmittingPatches). I'd prefer just putting a
hard-limit at 70 chars in your validation tool (#167), but I'm ok
putting a limit of 50 in that validation tool (and still merging if
"commit summary is too long" is the only error). I just think wedging
useful summaries into 50-len(prefix) is going to be more trouble than
its worth.
|
particular guideline? |
|
On Wed, Sep 09, 2015 at 03:55:36PM -0700, Vincent Batts wrote:
And you seem to have left out what I think is the most important point |
|
Not a strong compulsion. I wonder if there is a better phrasing for that
|
|
On Wed, Sep 09, 2015 at 04:08:56PM -0700, Vincent Batts wrote:
In Chris' post, each bullet point links to a section explaining why |
|
On Wed, Sep 09, 2015 at 04:17:44PM -0700, Vincent Batts wrote:
I'm fairly comfortable with his phrasing. I usually talk about |
efd907f to
3cbd157
Compare
|
updated |
|
And we can talk validation once the guide is in place. I'm not opposed to |
README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other entries are phrased to match an implicit “You should …”. For example, “You should separate…”. So maybe:
Prefix the subject (when possible) with a keyword scoping the change (e.g. “README: …”, “runtime: …”)
And maybe shift this up to sit with the other subject-related entries from earlier in the list.
|
On Wed, Sep 09, 2015 at 08:08:29PM -0700, Vincent Batts wrote:
Ok. I left some comments about minor nits with 3cbd157, but I don't think |
|
After I have read so many barren changelog from the docker.git, it is important that the following statement be included. All the important/useful/essential information on the conversation of the PR should be copied to the changelog. This statement makes |
|
@laijs is a link to the conversation sufficient? |
|
The link is inconvenient when I'm a 8years of linux-kernel developer of which community is highly value the changelog. |
|
On Thu, Sep 10, 2015 at 06:33:56AM -0700, Lai Jiangshan wrote:
This is my personal preference too, but if we're documenting good |
3cbd157 to
05d546a
Compare
|
@laijs PTAL |
|
The change in the *.md looks good to me. The rule 3/5 should apply for the sentence after the keyword of the subject, |
05d546a to
142c257
Compare
|
@laijs good point. :-) |
|
LGTM |
|
On Thu, Sep 10, 2015 at 05:41:52PM -0700, Lai Jiangshan wrote:
Other projects don't do this (e.g. git.git suggests lowecase after the
And I think this matches the style we're recommending. |
|
On Sep 11, 2015 12:14 AM, "W. Trevor King" [email protected] wrote:
What are you saying? Yes or no to capitalization? |
|
On Fri, Sep 11, 2015 at 04:15:57AM -0700, Vincent Batts wrote:
I'm agnostic on capitalization, but with the current capitalization |
|
k On Fri, Sep 11, 2015 at 10:05 AM, W. Trevor King [email protected]
|
|
LGTM |
Signed-off-by: Vincent Batts <[email protected]>
142c257 to
82835aa
Compare
|
LGTM |
README.md: adding a git style guide

pulled from http://chris.beams.io/posts/git-commit/
Signed-off-by: Vincent Batts [email protected]