sentia_git_hooks 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +50 -2
- data/bin/{sentia_git_hooks_install → sentia_git_hooks} +0 -0
- data/lib/scripts/commit-msg +16 -4
- data/lib/sentia_git_hooks/version.rb +1 -1
- data/sentia_git_hooks.gemspec +3 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 527233af4d756879927bbf07f705f8f08ded3738
|
4
|
+
data.tar.gz: 4947f3b755ae919842563024c05235ff1df40ce4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c35ee95f2e1e6d9acc2fb18a8309899f65b4938609b7d82382a21391903c5a863f4a84a6a6ee44cf71254088247d4d4d462956f96f7abb5257e8978479d5ae34
|
7
|
+
data.tar.gz: 614027894bc9ae9cc0c7ffb2dc0e32d24a7085276320d0f9d6939a9c958d34aec5ffa53777ebba8617d8b53d25f045a82ac3025e8df72675711074e29729bbe1
|
data/README.md
CHANGED
@@ -1,4 +1,52 @@
|
|
1
1
|
# Git hooks for enforcing various policies
|
2
2
|
|
3
|
-
##
|
4
|
-
|
3
|
+
## Setup
|
4
|
+
|
5
|
+
````
|
6
|
+
gem install 'sentia_git_hooks'
|
7
|
+
````
|
8
|
+
|
9
|
+
For each project you want to enforce this for run the following in the directory
|
10
|
+
|
11
|
+
````
|
12
|
+
sentia_git_hooks
|
13
|
+
````
|
14
|
+
|
15
|
+
## How to use
|
16
|
+
|
17
|
+
````
|
18
|
+
==============================================
|
19
|
+
Enforcing Sentia Commit Message Policy
|
20
|
+
==============================================
|
21
|
+
Fall in line soldier, correct commit format is
|
22
|
+
|
23
|
+
<id or ids> - Summary Message
|
24
|
+
o <newline>
|
25
|
+
p <Specific Message>
|
26
|
+
t <Specific Message>
|
27
|
+
i <Specific Message>
|
28
|
+
o <Specific Message>
|
29
|
+
n <Specific Message>
|
30
|
+
a <Specific Message>
|
31
|
+
l <Specific Message>
|
32
|
+
|
33
|
+
where
|
34
|
+
|
35
|
+
id = trello card/tracker issue id/number
|
36
|
+
|
37
|
+
eg
|
38
|
+
|
39
|
+
456 - Fix user.company nilclass issue with NullCompany
|
40
|
+
|
41
|
+
or
|
42
|
+
|
43
|
+
123 - Add archive post action
|
44
|
+
|
45
|
+
Add POST posts#archive action
|
46
|
+
Add GET posts#archived action
|
47
|
+
Add 'Archive' button to /posts/:id/edit page
|
48
|
+
Add hide archived posts from GET /posts
|
49
|
+
Add GET /posts/archived route and << views,
|
50
|
+
view styling is changed to make it obvious that
|
51
|
+
the post is archived
|
52
|
+
````
|
File without changes
|
data/lib/scripts/commit-msg
CHANGED
@@ -24,11 +24,15 @@ message = `cat #{commit_file}`
|
|
24
24
|
# Definitely something here
|
25
25
|
# More optional stuff"
|
26
26
|
#
|
27
|
-
|
27
|
+
message_filter = /\A(\d[\d ,]+) - ([^\n]+)\n(\n+(.+))?\z/m
|
28
|
+
bump_filter = /\ABump version number to ([\d.]+)\n\z/
|
29
|
+
merge_filter = /\AMerge \w* '(.*)' into (.*)\n\z/
|
28
30
|
|
29
|
-
|
30
|
-
|
31
|
-
|
31
|
+
if message_filter.match message
|
32
|
+
exit 0
|
33
|
+
elsif bump_filter.match message
|
34
|
+
exit 0
|
35
|
+
elsif merge_filter.match message
|
32
36
|
exit 0
|
33
37
|
else
|
34
38
|
puts ""
|
@@ -47,6 +51,14 @@ n <Specific Message>
|
|
47
51
|
a <Specific Message>
|
48
52
|
l <Specific Message>
|
49
53
|
|
54
|
+
or
|
55
|
+
|
56
|
+
Bump version number to x.x.x
|
57
|
+
|
58
|
+
or
|
59
|
+
|
60
|
+
Merge branch 'develop' into master
|
61
|
+
|
50
62
|
where
|
51
63
|
|
52
64
|
id = trello card/tracker issue id/number
|
data/sentia_git_hooks.gemspec
CHANGED
@@ -15,10 +15,12 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
-
spec.executables = ["
|
18
|
+
spec.executables = ["sentia_git_hooks"]
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.9"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
23
|
spec.add_development_dependency "pry"
|
24
|
+
spec.add_development_dependency "rspec"
|
25
|
+
|
24
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sentia_git_hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sia. S.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,11 +52,25 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: ''
|
56
70
|
email:
|
57
71
|
- sia.s.saj@gmail.com
|
58
72
|
executables:
|
59
|
-
-
|
73
|
+
- sentia_git_hooks
|
60
74
|
extensions: []
|
61
75
|
extra_rdoc_files: []
|
62
76
|
files:
|
@@ -68,7 +82,7 @@ files:
|
|
68
82
|
- README.md
|
69
83
|
- Rakefile
|
70
84
|
- bin/console
|
71
|
-
- bin/
|
85
|
+
- bin/sentia_git_hooks
|
72
86
|
- bin/setup
|
73
87
|
- lib/scripts/commit-msg
|
74
88
|
- lib/sentia_git_hooks.rb
|