git_pivotal_tracker 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -65,6 +65,18 @@ If you prefer to fast-forward your merges into the integration branch (default i
|
|
65
65
|
|
66
66
|
``git config --global pivotal.fast-forward 1``
|
67
67
|
|
68
|
+
If you prefer to choose one of the first 10 stories interactively:
|
69
|
+
|
70
|
+
``git config --global pivotal.interactive 1``
|
71
|
+
|
72
|
+
If you prefer to delete your topic branch after a successful merge into the integration branch:
|
73
|
+
|
74
|
+
``git config --global pivotal.delete-branch 1``
|
75
|
+
|
76
|
+
If you would only like to take stories that are assigned to you:
|
77
|
+
|
78
|
+
``git config --global pivotal.only-mine 1``
|
79
|
+
|
68
80
|
If your Pivotal Tracker user name is different than your git user name:
|
69
81
|
|
70
82
|
``git config --global pivotal.full-name 'Ben Lindsey'``
|
@@ -76,12 +88,13 @@ If you would like verbose logging turned on for git commands:
|
|
76
88
|
Author
|
77
89
|
------
|
78
90
|
|
79
|
-
* Ben Lindsey <ben@
|
91
|
+
* Ben Lindsey <ben@cumulo.us>
|
80
92
|
|
81
93
|
Contributors
|
82
94
|
------
|
83
95
|
|
84
|
-
* [https://github.com/lyahdav
|
96
|
+
* [Liron Yahdav](https://github.com/lyahdav)
|
97
|
+
* [Philippe Huibonhoa](https://github.com/phuibonhoa)
|
85
98
|
|
86
99
|
License
|
87
100
|
-------
|
@@ -73,7 +73,7 @@ module GitPivotalTracker
|
|
73
73
|
options[key.sub(/-/, '_').to_sym] = repository.config["pivotal.#{key}"]
|
74
74
|
end
|
75
75
|
|
76
|
-
['only-mine', 'include-rejected', 'fast-forward', 'rebase', 'verbose', 'use-ssl', 'interactive'].each do |key|
|
76
|
+
['only-mine', 'include-rejected', 'fast-forward', 'rebase', 'verbose', 'use-ssl', 'interactive', 'delete-branch'].each do |key|
|
77
77
|
options[key.sub(/-/, '_').to_sym] = repository.config["pivotal.#{key}"] == '1'
|
78
78
|
end
|
79
79
|
|
@@ -96,6 +96,7 @@ module GitPivotalTracker
|
|
96
96
|
opts.on("-R", "--rebase", "Fetch and rebase the integration branch before merging") { |r| options[:rebase] = r }
|
97
97
|
opts.on("-V", "--verbose", "Verbose command logging") { |v| options[:verbose] = v }
|
98
98
|
opts.on("-X", "--interactive", "Interactive story picking") { |x| options[:interactive] = x }
|
99
|
+
opts.on("-D", "--delete-branch", "Delete topic branch after merge") { |d| options[:delete_branch] = d }
|
99
100
|
opts.on_tail("-h", "--help", "This usage guide") { put opts.to_s; exit 0 }
|
100
101
|
end.parse!(args)
|
101
102
|
end
|
@@ -28,6 +28,7 @@ module GitPivotalTracker
|
|
28
28
|
|
29
29
|
puts "Marking Story #{story_id} as finished..."
|
30
30
|
if story.update(:current_state => finished_state)
|
31
|
+
delete_current_branch if options[:delete_branch]
|
31
32
|
puts "Success"
|
32
33
|
return 0
|
33
34
|
else
|
@@ -44,5 +45,10 @@ module GitPivotalTracker
|
|
44
45
|
def finished_state
|
45
46
|
story.story_type == "chore" ? "accepted" : "finished"
|
46
47
|
end
|
48
|
+
|
49
|
+
def delete_current_branch
|
50
|
+
puts "Deleting #{current_branch}"
|
51
|
+
log repository.git.branch({:raise => true, :d => true}, current_branch)
|
52
|
+
end
|
47
53
|
end
|
48
54
|
end
|
@@ -17,7 +17,7 @@ describe GitPivotalTracker::Base do
|
|
17
17
|
subject.options[:full_name].should be_nil
|
18
18
|
end
|
19
19
|
|
20
|
-
[:fast_forward, :rebase, :verbose, :use_ssl, :include_rejected, :only_mine, :interactive].each do |key|
|
20
|
+
[:fast_forward, :rebase, :verbose, :use_ssl, :include_rejected, :only_mine, :interactive, :delete_branch].each do |key|
|
21
21
|
it "does not set #{key}" do
|
22
22
|
subject.options[key].should_not be
|
23
23
|
end
|
@@ -78,6 +78,11 @@ describe GitPivotalTracker::Base do
|
|
78
78
|
GitPivotalTracker::Base.new("--interactive").options[:interactive].should be
|
79
79
|
GitPivotalTracker::Base.new("-X").options[:interactive].should be
|
80
80
|
end
|
81
|
+
|
82
|
+
it "sets delete_branch" do
|
83
|
+
GitPivotalTracker::Base.new("--delete-branch").options[:delete_branch].should be
|
84
|
+
GitPivotalTracker::Base.new("-D").options[:delete_branch].should be
|
85
|
+
end
|
81
86
|
end
|
82
87
|
|
83
88
|
describe "#parse_gitconfig" do
|
@@ -103,7 +108,8 @@ describe GitPivotalTracker::Base do
|
|
103
108
|
'pivotal.rebase' => '1',
|
104
109
|
'pivotal.verbose' => '1',
|
105
110
|
'pivotal.use-ssl' => '1',
|
106
|
-
'pivotal.interactive' => '1'
|
111
|
+
'pivotal.interactive' => '1',
|
112
|
+
'pivotal.delete-branch' => '1'
|
107
113
|
})
|
108
114
|
subject = GitPivotalTracker::Base.new
|
109
115
|
end
|
@@ -120,7 +126,7 @@ describe GitPivotalTracker::Base do
|
|
120
126
|
subject.options[:project_id].should == '123'
|
121
127
|
end
|
122
128
|
|
123
|
-
[:only_mine, :include_rejected, :fast_forward, :rebase, :verbose, :use_ssl, :interactive].each do |key|
|
129
|
+
[:only_mine, :include_rejected, :fast_forward, :rebase, :verbose, :use_ssl, :interactive, :delete_branch].each do |key|
|
124
130
|
it "sets #{key}" do
|
125
131
|
subject.options[key].should be
|
126
132
|
end
|
@@ -59,6 +59,11 @@ describe GitPivotalTracker::Finish do
|
|
59
59
|
@repo.commits( @current_head.name ).first.sha.should == @sha
|
60
60
|
end
|
61
61
|
|
62
|
+
it "does not delete the topic branch" do
|
63
|
+
finish.run!.should == 0
|
64
|
+
@repo.git.branch.should match @new_branch
|
65
|
+
end
|
66
|
+
|
62
67
|
context "when I have rebase turned on" do
|
63
68
|
before do
|
64
69
|
finish.options[:rebase] = 1
|
@@ -81,5 +86,16 @@ describe GitPivotalTracker::Finish do
|
|
81
86
|
@repo.heads.detect { |h| h.name == @current_head.name }.commit.sha.should == @sha
|
82
87
|
end
|
83
88
|
end
|
89
|
+
|
90
|
+
context "when I have delete branch turned on" do
|
91
|
+
before do
|
92
|
+
finish.options[:delete_branch] = 1
|
93
|
+
end
|
94
|
+
|
95
|
+
it "deletes the topic branch after merging" do
|
96
|
+
finish.run!.should == 0
|
97
|
+
@repo.git.branch.should_not match @new_branch
|
98
|
+
end
|
99
|
+
end
|
84
100
|
end
|
85
101
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_pivotal_tracker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70254038532080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70254038532080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: webmock
|
27
|
-
requirement: &
|
27
|
+
requirement: &70254038531620 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70254038531620
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: aruba
|
38
|
-
requirement: &
|
38
|
+
requirement: &70254038531200 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70254038531200
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: grit
|
49
|
-
requirement: &
|
49
|
+
requirement: &70254038530780 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70254038530780
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: pivotal-tracker
|
60
|
-
requirement: &
|
60
|
+
requirement: &70254038530360 !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: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70254038530360
|
69
69
|
description: provides a set of git workflow tools to start and finish Pivotal Tracker
|
70
70
|
stories in topic branches
|
71
71
|
email:
|