pivotal-github 0.5.6 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -101,12 +101,18 @@ Because of the way options are chained, passing the option `--ff` to `git story-
101
101
 
102
102
  #### Options
103
103
 
104
- Usage: git story-merge [options]
105
- -d, --development BRANCH development branch (defaults to master)
106
- -h, --help this usage guide
104
+ Usage: git story-merge [options]
105
+ -d, --development BRANCH development branch (defaults to master)
106
+ -h, --help this usage guide
107
107
 
108
108
  Additionally, `git story-merge` accepts any options valid for `git merge`.
109
109
 
110
+ ### git story-pull-request
111
+
112
+ `git story-pull-request` opens the proper remote URI to issue a pull request for the current branch (OS–X only):
113
+
114
+ $ git story-pull-request
115
+
110
116
  ### story-open
111
117
 
112
118
  The `story-open` command (*note*: no `git`) opens the current story in the default browser (OS X–only):
@@ -120,10 +126,11 @@ In order to use the `pivotal-github` gem, you need to configure a [post-receive
120
126
 
121
127
  The `pivotal-github` command names follow the Git convention of being verbose (e.g., unlike Subversion, Git doesn't natively support `co` for `checkout`), but I recommend setting up aliases as necessary. Here are some suggestions:
122
128
 
123
- $ git config --global alias.sc story-commit
124
- $ git config --global alias.sp story-push
125
- $ git config --global alias.sl story-pull
126
- $ git config --global alias.sm story-merge
129
+ git config --global alias.sc story-commit
130
+ git config --global alias.sp story-push
131
+ git config --global alias.sl story-pull
132
+ git config --global alias.sm story-merge
133
+ git config --global alias.spr story-pull-request
127
134
 
128
135
  A single-developer workflow would then look like this:
129
136
 
@@ -163,6 +170,9 @@ Here's the process in detail:
163
170
  7. Go the story at Pivotal Tracker and change the **Owner** to Developer #2 (Bob)
164
171
  8. Continue working, taking care to branch off of the current story branch if its changes are required to continue
165
172
 
173
+ Rather than immediately submitting a pull request, Alice can also continue by branching off the previous story branch, working on a set of related features, and then issue Bob a pull request for the final branch when she reaches a natural stopping place.
174
+
175
+
166
176
  ### Developer #2 (Bob)
167
177
 
168
178
  1. Select **Pull Requests** at GitHub and review the pull request diffs
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
+ require 'pivotal-github/story_pull_request'
4
+
5
+ exit Command.run!(StoryPullRequest, ARGV.dup)
@@ -0,0 +1,26 @@
1
+ require 'pivotal-github/command'
2
+
3
+ class StoryPullRequest < Command
4
+
5
+ # Returns a command appropriate for executing at the command line
6
+ # I.e., 'open https://www.pivotaltracker.com/story/show/6283185'
7
+ def cmd
8
+ "open #{uri}"
9
+ end
10
+
11
+ def uri
12
+ "#{origin_uri}/pull/new/#{story_branch}"
13
+ end
14
+
15
+ def run!
16
+ system cmd
17
+ end
18
+
19
+ private
20
+
21
+ # Returns the remote URI for the repository
22
+ # E.g., https://github.com/mhartl/pivotal-github
23
+ def origin_uri
24
+ `git config --get remote.origin.url`.strip.chomp('.git')
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  module Pivotal
2
2
  module Github
3
- VERSION = "0.5.6"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -6,3 +6,4 @@ require "pivotal-github/story_push"
6
6
  require "pivotal-github/story_pull"
7
7
  require "pivotal-github/story_merge"
8
8
  require "pivotal-github/story_open"
9
+ require "pivotal-github/story_pull_request"
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe StoryPullRequest do
4
+
5
+ let(:command) { StoryPullRequest.new }
6
+ before { command.stub(:story_branch).and_return('6283185-tau-manifesto') }
7
+ before do
8
+ command.stub(:origin_uri).and_return('https://github.com/mhartl/foo')
9
+ end
10
+ subject { command }
11
+
12
+ its(:cmd) { should == "open #{command.uri}" }
13
+
14
+ describe "command-line command" do
15
+ subject { `bin/git-story-pull-request --debug` }
16
+ it { should =~ /pull\/new/ }
17
+ it { should_not =~ /\.git/ }
18
+ end
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-12 00:00:00.000000000 Z
12
+ date: 2013-02-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Add commands for Pivotal Tracker–GitHub integration
15
15
  email:
@@ -18,6 +18,7 @@ executables:
18
18
  - git-story-commit
19
19
  - git-story-merge
20
20
  - git-story-pull
21
+ - git-story-pull-request
21
22
  - git-story-push
22
23
  - story-open
23
24
  extensions: []
@@ -32,6 +33,7 @@ files:
32
33
  - bin/git-story-commit
33
34
  - bin/git-story-merge
34
35
  - bin/git-story-pull
36
+ - bin/git-story-pull-request
35
37
  - bin/git-story-push
36
38
  - bin/story-open
37
39
  - lib/pivotal-github.rb
@@ -41,6 +43,7 @@ files:
41
43
  - lib/pivotal-github/story_merge.rb
42
44
  - lib/pivotal-github/story_open.rb
43
45
  - lib/pivotal-github/story_pull.rb
46
+ - lib/pivotal-github/story_pull_request.rb
44
47
  - lib/pivotal-github/story_push.rb
45
48
  - lib/pivotal-github/version.rb
46
49
  - pivotal-github.gemspec
@@ -48,6 +51,7 @@ files:
48
51
  - spec/commands/story_commit_spec.rb
49
52
  - spec/commands/story_merge_spec.rb
50
53
  - spec/commands/story_open_spec.rb
54
+ - spec/commands/story_pull_request_spec.rb
51
55
  - spec/commands/story_push_spec.rb
52
56
  - spec/options/options_spec.rb
53
57
  - spec/options/story_pull_spec.rb
@@ -81,6 +85,7 @@ test_files:
81
85
  - spec/commands/story_commit_spec.rb
82
86
  - spec/commands/story_merge_spec.rb
83
87
  - spec/commands/story_open_spec.rb
88
+ - spec/commands/story_pull_request_spec.rb
84
89
  - spec/commands/story_push_spec.rb
85
90
  - spec/options/options_spec.rb
86
91
  - spec/options/story_pull_spec.rb