git_tracker 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +12 -0
- data/lib/git_tracker/branch.rb +1 -1
- data/lib/git_tracker/version.rb +1 -1
- data/spec/git_tracker/branch_spec.rb +35 -24
- metadata +11 -11
data/README.md
CHANGED
@@ -70,6 +70,18 @@ the top)*
|
|
70
70
|
|
71
71
|
You should then add a [useful and responsible commit message][tpope]. :heart:
|
72
72
|
|
73
|
+
### Valid branch names
|
74
|
+
|
75
|
+
*git_tracker* allows you to include the story number any where in the branch
|
76
|
+
name, optionally prefixing it with a hash (`#`). Examples:
|
77
|
+
|
78
|
+
- `best_feature_ever_#8675309`
|
79
|
+
- `best_feature_ever_8675309`
|
80
|
+
- `8675309_best_feature_ever`
|
81
|
+
- `#8675309_best_feature_ever`
|
82
|
+
- `your_name/8675309_best_feature_ever`
|
83
|
+
- `your_name/#8675309_best_feature_ever`
|
84
|
+
|
73
85
|
### Passing commit messages via command line
|
74
86
|
|
75
87
|
If you pass a commit message on the command line the hook will still add the
|
data/lib/git_tracker/branch.rb
CHANGED
data/lib/git_tracker/version.rb
CHANGED
@@ -4,44 +4,55 @@ describe GitTracker::Branch do
|
|
4
4
|
subject { described_class }
|
5
5
|
|
6
6
|
def stub_branch(ref, exit_status = 0)
|
7
|
+
allow_message_expectations_on_nil
|
7
8
|
subject.stub(:`) { ref }
|
8
9
|
$?.stub(:exitstatus) { exit_status }
|
9
10
|
end
|
10
11
|
|
11
|
-
|
12
|
-
it '
|
12
|
+
describe '.current' do
|
13
|
+
it 'shells out to git, looking for the current HEAD' do
|
14
|
+
stub_branch('refs/heads/herpty_derp_de')
|
15
|
+
subject.should_receive('`').with('git symbolic-ref HEAD')
|
16
|
+
subject.current
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'aborts with non-zero exit status when not in a Git repository' do
|
13
20
|
stub_branch(nil, 128)
|
14
21
|
|
15
22
|
-> { subject.current }.should raise_error SystemExit
|
16
23
|
end
|
17
24
|
end
|
18
25
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
26
|
+
describe '.story_number' do
|
27
|
+
context "Current branch has a story number" do
|
28
|
+
it "finds the story that starts with a hash" do
|
29
|
+
stub_branch('refs/heads/a_very_descriptive_name_#8675309')
|
30
|
+
subject.story_number.should == '8675309'
|
31
|
+
end
|
32
|
+
|
33
|
+
it "finds the story without a leading hash" do
|
34
|
+
stub_branch('refs/heads/a_very_descriptive_name_1235309')
|
35
|
+
subject.story_number.should == '1235309'
|
36
|
+
end
|
37
|
+
|
38
|
+
it "finds the story following a forward hash" do
|
39
|
+
stub_branch('refs/heads/alindeman/8675309_got_her_number')
|
40
|
+
subject.story_number.should == '8675309'
|
41
|
+
end
|
27
42
|
end
|
28
43
|
|
29
|
-
|
30
|
-
|
44
|
+
context "The current branch doesn't have a story number" do
|
45
|
+
it "finds no story" do
|
46
|
+
stub_branch('refs/heads/a_very_descriptive_name_without_a_#number')
|
47
|
+
subject.story_number.should_not be
|
48
|
+
end
|
31
49
|
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context "The current branch doesn't have a story number" do
|
35
|
-
it "finds no story" do
|
36
|
-
stub_branch('refs/heads/a_very_descriptive_name_without_a_#number')
|
37
|
-
subject.story_number.should_not be
|
38
|
-
end
|
39
|
-
end
|
40
50
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
51
|
+
context "Not on a branch (HEAD doesn't exist)" do
|
52
|
+
it "finds no story" do
|
53
|
+
stub_branch('')
|
54
|
+
subject.story_number.should_not be
|
55
|
+
end
|
45
56
|
end
|
46
57
|
end
|
47
58
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-03 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70367025411540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.9.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70367025411540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec-spies
|
27
|
-
requirement: &
|
27
|
+
requirement: &70367025410760 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70367025410760
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pry
|
38
|
-
requirement: &
|
38
|
+
requirement: &70367025410280 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.8
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70367025410280
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: activesupport
|
49
|
-
requirement: &
|
49
|
+
requirement: &70367025409820 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.2'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70367025409820
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70367025409440 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70367025409440
|
69
69
|
description: ! " Some simple tricks that make working with Pivotal Tracker even\n
|
70
70
|
\ better... and easier... um, besier!\n"
|
71
71
|
email:
|