[ARVADOS-DEV] updated: 874f78e7f17a15da00e4aad0c9bc14620330dded
git at public.curoverse.com
git at public.curoverse.com
Thu Jun 5 14:27:19 EDT 2014
Summary of changes:
git/hooks/coding-standards.sh | 48 +++++++++++++++++++++++++------------------
jenkins/run-build-packages.sh | 6 ++++++
2 files changed, 34 insertions(+), 20 deletions(-)
via 874f78e7f17a15da00e4aad0c9bc14620330dded (commit)
via e688effcdc8513fe5acc24116857c71edb306267 (commit)
via be1ff42eb4380029fa7118b9fb822fa88dfb1594 (commit)
from 2147a538d2b64392a2c86e90a123c47e7efaac24 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 874f78e7f17a15da00e4aad0c9bc14620330dded
Author: Ward Vandewege <ward at curoverse.com>
Date: Thu Jun 5 14:25:47 2014 -0400
A few fixes:
a) clarify error message when doing a fast-forward merge rejection
b) reduce number of gratuitous newlines
c) do not test for issue numbers when a fast-forward merge is being
attempted, because that test will complain about every commit, obscuring
the real problem (the fast-forward merge)
diff --git a/git/hooks/coding-standards.sh b/git/hooks/coding-standards.sh
index d1b03dc..bc75a58 100755
--- a/git/hooks/coding-standards.sh
+++ b/git/hooks/coding-standards.sh
@@ -32,37 +32,42 @@ def check_message_format
merge_revs = `git rev-list --first-parent --min-parents=2 #{$oldrev}..#{$newrev}`.split("\n")
# single_revs = `git rev-list --first-parent --max-parents=1 #{$oldrev}..#{$newrev}`.split("\n")
broken = false
+ no_ff = false
merge_revs.each do |rev|
message = `git cat-file commit #{rev} | sed '1,/^$/d'`
if $wrong_way_merge_master.match(message)
- puts "\n[POLICY] This appears to be a merge from master into a feature\n"
- puts "\nbranch. Commits to master must merge from the feature\n"
- puts "\nbranch into master.\n\n"
+ puts "\n[POLICY] Only non-fast-forward merges into master are allowed. Please"
+ puts "reset your master branch:"
+ puts " git reset --hard origin/master"
+ puts "and then merge your branch with the --no-ff option:"
+ puts " git merge your-branch --no-ff\n"
+ puts "Remember to add a reference to an issue number in the merge commit!\n"
puts "\n******************************************************************\n"
- puts "\nOffending commit: #{rev}\n\n"
- puts "\nOffending commit message:\n\n"
+ puts "\nOffending commit: #{rev}\n"
+ puts "\nOffending commit message:\n"
puts message
puts "\n******************************************************************\n"
puts "\n\n"
broken = true
+ no_ff = true
elsif $pull_merge.match(message)
- puts "\n[POLICY] This appears to be a git pull merge of remote master into local\n"
- puts "\nmaster. In order to maintain a linear first-parent history of master,\n"
- puts "\nplease reset your branch and remerge or rebase using the latest master.\n"
+ puts "\n[POLICY] This appears to be a git pull merge of remote master into local"
+ puts "master. In order to maintain a linear first-parent history of master,"
+ puts "please reset your branch and remerge or rebase using the latest master.\n"
puts "\n******************************************************************\n"
- puts "\nOffending commit: #{rev}\n\n"
+ puts "\nOffending commit: #{rev}\n"
puts "\nOffending commit message:\n\n"
puts message
puts "\n******************************************************************\n"
puts "\n\n"
broken = true
elsif not $merge_master.match(message) and not
- puts "\n[POLICY] This does not appear to be a merge of a feature\n"
- puts "\nbranch into master. Merges must follow the format\n"
- puts "\n\"Merge branch 'feature-branch'\".\n"
+ puts "\n[POLICY] This does not appear to be a merge of a feature"
+ puts "branch into master. Merges must follow the format"
+ puts "\"Merge branch 'feature-branch'\".\n"
puts "\n******************************************************************\n"
- puts "\nOffending commit: #{rev}\n\n"
+ puts "\nOffending commit: #{rev}\n"
puts "\nOffending commit message:\n\n"
puts message
puts "\n******************************************************************\n"
@@ -74,10 +79,10 @@ def check_message_format
all_revs.each do |rev|
message = `git cat-file commit #{rev} | sed '1,/^$/d'`
if $broken_commit_message.match(message)
- puts "\n[POLICY] Rejected broken commit message for including boilerplate\n"
- puts "\ninstruction text.\n\n"
+ puts "\n[POLICY] Rejected broken commit message for including boilerplate"
+ puts "instruction text.\n"
puts "\n******************************************************************\n"
- puts "\nOffending commit: #{rev}\n\n"
+ puts "\nOffending commit: #{rev}\n"
puts "\nOffending commit message:\n\n"
puts message
puts "\n******************************************************************\n"
@@ -85,11 +90,14 @@ def check_message_format
broken = true
end
- if not $refs_or_closes_or_no_issue.match(message)
- puts "\n[POLICY] All commits to master must include an issue using \"refs #\" or\n"
- puts "\n\"closes #\", or specify \"no issue #\"\n\n"
+ # Do not test when the commit is a no_ff merge (which will be rejected), because
+ # this test will complain about *every* commit in the merge otherwise, obscuring
+ # the real reason for the rejection (the no_ff merge)
+ if not no_ff and not $refs_or_closes_or_no_issue.match(message)
+ puts "\n[POLICY] All commits to master must include an issue using \"refs #\" or"
+ puts "\"closes #\", or specify \"no issue #\"\n"
puts "\n******************************************************************\n"
- puts "\nOffending commit: #{rev}\n\n"
+ puts "\nOffending commit: #{rev}\n"
puts "\nOffending commit message:\n\n"
puts message
puts "\n******************************************************************\n"
commit e688effcdc8513fe5acc24116857c71edb306267
Merge: be1ff42 2147a53
Author: Ward Vandewege <ward at curoverse.com>
Date: Thu Jun 5 13:52:39 2014 -0400
Merge branch 'new-git-hooks' of git.curoverse.com:arvados-dev into new-git-hooks
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list