git_reflow 0.7.5 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Appraisals +2 -2
  4. data/CHANGELOG.md +75 -0
  5. data/Gemfile.lock +34 -35
  6. data/README.rdoc +187 -60
  7. data/circle.yml +9 -9
  8. data/git_reflow.gemspec +8 -8
  9. data/lib/git_reflow/commands/deliver.rb +1 -9
  10. data/lib/git_reflow/commands/refresh.rb +23 -0
  11. data/lib/git_reflow/commands/review.rb +7 -7
  12. data/lib/git_reflow/commands/setup.rb +7 -3
  13. data/lib/git_reflow/commands/start.rb +13 -5
  14. data/lib/git_reflow/git_helpers.rb +22 -23
  15. data/lib/git_reflow/git_server/bit_bucket/pull_request.rb +4 -4
  16. data/lib/git_reflow/git_server/bit_bucket.rb +7 -7
  17. data/lib/git_reflow/git_server/git_hub/pull_request.rb +75 -2
  18. data/lib/git_reflow/git_server/git_hub.rb +17 -8
  19. data/lib/git_reflow/git_server/pull_request.rb +73 -5
  20. data/lib/git_reflow/git_server.rb +3 -3
  21. data/lib/git_reflow/merge_error.rb +9 -0
  22. data/lib/git_reflow/sandbox.rb +4 -16
  23. data/lib/git_reflow/version.rb +1 -1
  24. data/lib/git_reflow.rb +32 -75
  25. data/spec/git_reflow_spec.rb +157 -141
  26. data/spec/lgtm_git_reflow_spec.rb +165 -139
  27. data/spec/lib/git_reflow/git_helpers_spec.rb +19 -63
  28. data/spec/lib/git_reflow/git_server_spec.rb +24 -24
  29. data/spec/lib/git_server/bit_bucket_spec.rb +12 -12
  30. data/spec/lib/git_server/git_hub/pull_request_spec.rb +7 -5
  31. data/spec/lib/git_server/git_hub_spec.rb +34 -34
  32. data/spec/lib/git_server/pull_request_spec.rb +207 -16
  33. data/spec/support/command_line_helpers.rb +14 -9
  34. data/spec/support/github_helpers.rb +21 -21
  35. data/spec/support/rspec_stub_helpers.rb +2 -2
  36. metadata +18 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6773486dad59a6ec3d71cd0047234005b8d06f1
4
- data.tar.gz: 07665f57499a6aab0bd31218a0bf8d5e147c8581
3
+ metadata.gz: b9d16b34d650be359faa1d19b5984cad9af10aae
4
+ data.tar.gz: 067b869fe2e45df0162b308cd1fddf60618f8b49
5
5
  SHA512:
6
- metadata.gz: 930b0d1bb58185c59c0d759ef2aad44a10d2b2481bd78843f842c4b703c4b4770a29574cb34be888d01035db40fd66f10df45e343427c2fafee37e06791a1602
7
- data.tar.gz: 8aa0cbcf0db37dcbb527f2275cef16125d7f736a18787700e1fc16c2934b68ac75f0f0e2713d1790c5e90efca256926be9df200f3baa61ae8aae427411facd1c
6
+ metadata.gz: 1ee6a2721fe04f0ab7bedc0dbf75100aad1398824d00387022ff7faf5fcb99f507743a5388ad287e267f95a23fb4975d14da4dfba25bba270108874aefd46297
7
+ data.tar.gz: 5f85cac1cab156f241684fa5181218cfcbc7e21ea0568f29d6d6882759f59a605d20c30c520b4f314eabfbb7b087c8cedb1cd25a707985d2800f231efb0437f5
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ pkg/*
3
3
  .rspec
4
4
  gemfiles
5
5
  *.gem
6
+ .byebug_history
data/Appraisals CHANGED
@@ -7,6 +7,6 @@ appraise "latest-github-api-release" do
7
7
  end
8
8
 
9
9
  appraise "current-reflow-locked-versions" do
10
- gem "gli", "2.13.2"
11
- gem "github_api", "0.12.4"
10
+ gem "gli", "2.14.0"
11
+ gem "github_api", "0.14.0"
12
12
  end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.8.0](https://github.com/reenhanced/gitreflow/tree/v0.8.0) (2016-05-26)
4
+
5
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.5...v0.8.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Upgrade RSpec [\#162](https://github.com/reenhanced/gitreflow/issues/162)
10
+
11
+ **Closed issues:**
12
+
13
+ - Setup doesn't work with GH two-factor turned on [\#175](https://github.com/reenhanced/gitreflow/issues/175)
14
+ - --base switch does not work? [\#174](https://github.com/reenhanced/gitreflow/issues/174)
15
+ - Idea: git reflow promote \<promotion branch\> [\#168](https://github.com/reenhanced/gitreflow/issues/168)
16
+ - add changelog support [\#100](https://github.com/reenhanced/gitreflow/issues/100)
17
+ - Always have reflow start create a branch from master [\#66](https://github.com/reenhanced/gitreflow/issues/66)
18
+
19
+ **Merged pull requests:**
20
+
21
+ - Cleanup new Github merge for next release [\#172](https://github.com/reenhanced/gitreflow/pull/172) ([codenamev](https://github.com/codenamev))
22
+ - Bug Fix for Merging "reenhanced:master" instead of "master" [\#171](https://github.com/reenhanced/gitreflow/pull/171) ([simonzhu24](https://github.com/simonzhu24))
23
+ - Sz issue/149 fix commit message to merge instead of close [\#170](https://github.com/reenhanced/gitreflow/pull/170) ([simonzhu24](https://github.com/simonzhu24))
24
+ - Fixing Refresh to take in parameter for "base" instead of "branch" [\#169](https://github.com/reenhanced/gitreflow/pull/169) ([simonzhu24](https://github.com/simonzhu24))
25
+ - \[Issue \#66\] Always have reflow start create a branch from master [\#167](https://github.com/reenhanced/gitreflow/pull/167) ([simonzhu24](https://github.com/simonzhu24))
26
+ - \[162\] Updating Rspec Version to 3.3.0 [\#165](https://github.com/reenhanced/gitreflow/pull/165) ([simonzhu24](https://github.com/simonzhu24))
27
+ - \[Issue \#66 + \#74\] Implementing "Git Reflow Refresh" [\#164](https://github.com/reenhanced/gitreflow/pull/164) ([simonzhu24](https://github.com/simonzhu24))
28
+ - \[issue: 162\] Updating Rspecs: Use "Allow" instead of "Stub" [\#163](https://github.com/reenhanced/gitreflow/pull/163) ([simonzhu24](https://github.com/simonzhu24))
29
+
30
+ ## [v0.7.5](https://github.com/reenhanced/gitreflow/tree/v0.7.5) (2016-04-14)
31
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.4...v0.7.5)
32
+
33
+ **Implemented enhancements:**
34
+
35
+ - Modernize gem file structure [\#158](https://github.com/reenhanced/gitreflow/issues/158)
36
+
37
+ **Closed issues:**
38
+
39
+ - Remove unused gitreflow-common [\#154](https://github.com/reenhanced/gitreflow/issues/154)
40
+ - Option to require LGTM from only one person? [\#141](https://github.com/reenhanced/gitreflow/issues/141)
41
+
42
+ **Merged pull requests:**
43
+
44
+ - \[Issue \#141\] Fixing Issues and Adding Configurable Nx LGTM and LGTM Regex Options, Adding Rspec Tests [\#161](https://github.com/reenhanced/gitreflow/pull/161) ([simonzhu24](https://github.com/simonzhu24))
45
+ - modernize gem structure; Fixes \#158 [\#159](https://github.com/reenhanced/gitreflow/pull/159) ([pboling](https://github.com/pboling))
46
+ - Remove unused gitreflow-common [\#155](https://github.com/reenhanced/gitreflow/pull/155) ([pboling](https://github.com/pboling))
47
+
48
+ ## [v0.7.4](https://github.com/reenhanced/gitreflow/tree/v0.7.4) (2016-04-08)
49
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.3...v0.7.4)
50
+
51
+ **Fixed bugs:**
52
+
53
+ - Deliver command doesn't sync feature branch before merge [\#152](https://github.com/reenhanced/gitreflow/issues/152)
54
+ - SSL Verification is turned off [\#151](https://github.com/reenhanced/gitreflow/issues/151)
55
+
56
+ ## [v0.7.3](https://github.com/reenhanced/gitreflow/tree/v0.7.3) (2016-03-24)
57
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.2...v0.7.3)
58
+
59
+ **Fixed bugs:**
60
+
61
+ - Setting title is ignored from review [\#127](https://github.com/reenhanced/gitreflow/issues/127)
62
+ - Don't open EDITOR if there is an existing PR for this branch [\#123](https://github.com/reenhanced/gitreflow/issues/123)
63
+
64
+ **Closed issues:**
65
+
66
+ - add "Created With Reflow" [\#101](https://github.com/reenhanced/gitreflow/issues/101)
67
+ - Store OAuth token somewhere else? [\#54](https://github.com/reenhanced/gitreflow/issues/54)
68
+
69
+ ## [v0.7.2](https://github.com/reenhanced/gitreflow/tree/v0.7.2) (2016-02-22)
70
+ [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.1...v0.7.2)
71
+
72
+ **Closed issues:**
73
+
74
+ - git: 'reflow' is not a git command. See 'git --help' [\#146](https://github.com/reenhanced/gitreflow/issues/146)
75
+ - option to use non-master branch by default everywhere [\#145](https://github.com/reenhanced/gitreflow/issues/145)
76
+ - Deliver to custom branch? [\#144](https://github.com/reenhanced/gitreflow/issues/144)
77
+
3
78
  ## [v0.7.1](https://github.com/reenhanced/gitreflow/tree/v0.7.1) (2015-10-27)
4
79
  [Full Changelog](https://github.com/reenhanced/gitreflow/compare/v0.7.0...v0.7.1)
5
80
 
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_reflow (0.7.5)
4
+ git_reflow (0.8.0)
5
5
  colorize (>= 0.7.0)
6
- github_api (= 0.12.4)
7
- gli (= 2.13.2)
6
+ github_api (= 0.14.0)
7
+ gli (= 2.14.0)
8
8
  highline
9
9
  httpclient
10
10
  reenhanced_bitbucket_api (= 0.3.2)
@@ -13,11 +13,11 @@ GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
15
  addressable (2.4.0)
16
- appraisal (1.0.3)
16
+ appraisal (2.1.0)
17
17
  bundler
18
18
  rake
19
19
  thor (>= 0.14.0)
20
- byebug (8.2.2)
20
+ byebug (9.0.4)
21
21
  chronic (0.10.2)
22
22
  coderay (1.1.1)
23
23
  colorize (0.7.7)
@@ -30,24 +30,22 @@ GEM
30
30
  multipart-post (>= 1.2, < 3)
31
31
  faraday_middleware (0.9.2)
32
32
  faraday (>= 0.7.4, < 0.10)
33
- github_api (0.12.4)
34
- addressable (~> 2.3)
33
+ github_api (0.14.0)
34
+ addressable (~> 2.4.0)
35
35
  descendants_tracker (~> 0.0.4)
36
36
  faraday (~> 0.8, < 0.10)
37
37
  hashie (>= 3.4)
38
- multi_json (>= 1.7.5, < 2.0)
39
- nokogiri (~> 1.6.6)
40
38
  oauth2
41
- gli (2.13.2)
39
+ gli (2.14.0)
42
40
  hashdiff (0.3.0)
43
- hashie (3.4.3)
41
+ hashie (3.4.4)
44
42
  highline (1.7.8)
45
- httpclient (2.7.1)
43
+ httpclient (2.8.0)
46
44
  json (1.8.3)
47
45
  jwt (1.5.1)
48
46
  method_source (0.8.2)
49
47
  mini_portile2 (2.0.0)
50
- multi_json (1.11.2)
48
+ multi_json (1.12.1)
51
49
  multi_xml (0.5.5)
52
50
  multipart-post (2.0.0)
53
51
  nokogiri (1.6.7.2)
@@ -62,11 +60,11 @@ GEM
62
60
  coderay (~> 1.1.0)
63
61
  method_source (~> 0.8.1)
64
62
  slop (~> 3.4)
65
- pry-byebug (3.3.0)
66
- byebug (~> 8.0)
63
+ pry-byebug (3.4.0)
64
+ byebug (~> 9.0)
67
65
  pry (~> 0.10)
68
66
  rack (1.6.4)
69
- rake (10.5.0)
67
+ rake (11.1.2)
70
68
  rdoc (4.2.2)
71
69
  json (~> 1.4)
72
70
  reenhanced_bitbucket_api (0.3.2)
@@ -76,43 +74,44 @@ GEM
76
74
  multi_json (>= 1.7.5, < 2.0)
77
75
  nokogiri (>= 1.5.2)
78
76
  simple_oauth (>= 0.3.0)
79
- rspec (3.0.0)
80
- rspec-core (~> 3.0.0)
81
- rspec-expectations (~> 3.0.0)
82
- rspec-mocks (~> 3.0.0)
83
- rspec-core (3.0.4)
84
- rspec-support (~> 3.0.0)
85
- rspec-expectations (3.0.4)
77
+ rspec (3.4.0)
78
+ rspec-core (~> 3.4.0)
79
+ rspec-expectations (~> 3.4.0)
80
+ rspec-mocks (~> 3.4.0)
81
+ rspec-core (3.4.4)
82
+ rspec-support (~> 3.4.0)
83
+ rspec-expectations (3.4.0)
84
+ diff-lcs (>= 1.2.0, < 2.0)
85
+ rspec-support (~> 3.4.0)
86
+ rspec-mocks (3.4.1)
86
87
  diff-lcs (>= 1.2.0, < 2.0)
87
- rspec-support (~> 3.0.0)
88
- rspec-mocks (3.0.4)
89
- rspec-support (~> 3.0.0)
90
- rspec-support (3.0.4)
88
+ rspec-support (~> 3.4.0)
89
+ rspec-support (3.4.1)
91
90
  safe_yaml (1.0.4)
92
91
  simple_oauth (0.3.1)
93
92
  slop (3.6.0)
94
93
  thor (0.19.1)
95
94
  thread_safe (0.3.5)
96
- webmock (1.24.0)
95
+ webmock (2.0.3)
97
96
  addressable (>= 2.3.6)
98
97
  crack (>= 0.3.2)
99
98
  hashdiff
100
- wwtd (0.7.0)
99
+ wwtd (1.3.0)
101
100
 
102
101
  PLATFORMS
103
102
  ruby
104
103
 
105
104
  DEPENDENCIES
106
- appraisal (= 1.0.3)
107
- bundler (~> 1.11)
105
+ appraisal (= 2.1.0)
106
+ bundler (~> 1.12)
108
107
  chronic
109
108
  git_reflow!
110
109
  pry-byebug
111
- rake (~> 10.0)
110
+ rake (~> 11.0)
112
111
  rdoc
113
- rspec (~> 3.0)
112
+ rspec (~> 3.4.0)
114
113
  webmock
115
- wwtd (= 0.7.0)
114
+ wwtd (= 1.3.0)
116
115
 
117
116
  BUNDLED WITH
118
- 1.11.2
117
+ 1.12.3
data/README.rdoc CHANGED
@@ -1,6 +1,14 @@
1
1
  = git-reflow (2015 Fukuoka Ruby Award Winner)
2
2
 
3
- {<img src="https://circleci.com/gh/reenhanced/gitreflow/tree/master.svg?style=svg" alt="Circle CI" />}[https://circleci.com/gh/reenhanced/gitreflow/tree/master]
3
+ {<img src="https://circleci.com/gh/reenhanced/gitreflow.svg?style=svg" alt="Circle CI" />}[https://circleci.com/gh/reenhanced/gitreflow]
4
+ {<img src="https://img.shields.io/badge/git--reflow-v0.7.5-blue.svg?style=flat&link=https://github.com/reenhanced/gitreflow" alt="Git workflow powered by git-reflow" />}[https://github.com/reenhanced/gitreflow]
5
+ {<img
6
+ src="https://img.shields.io/badge/git--reflow-v0.7.5-blue.svg?style=flat&link=http://www.rubydoc.info/gems/git_reflow"
7
+ alt="Git workflow powered by git-reflow"
8
+ />}[http://www.rubydoc.info/gems/git_reflow]
9
+ {<img src="http://inch-ci.org/github/reenhanced/gitreflow.svg?branch=master&style=shields" alt="Documentation" />}[http://inch-ci.org/github/reenhanced/gitreflow]
10
+
11
+ {RDocs}[http://www.rubydoc.info/gems/git_reflow]
4
12
 
5
13
  http://reenhanced.com/reflow/git-reflow-deliver.gif
6
14
 
@@ -20,10 +28,10 @@ Reflow automatically creates pull requests, ensures the code review is approved,
20
28
  Create and switch to new branch +nh-branchy-branch+:
21
29
  $ git reflow start nh-branchy-branch
22
30
 
23
- Create a pull request for your branch against +master+:
31
+ Create a pull request for your branch against +master+ or a custom +base_branch+:
24
32
  $ git reflow review
25
33
 
26
- If your code is 'LGTM'd, squash merge to +master+ and delete the feature branch:
34
+ If your code is 'LGTM'd, squash merge to +base_branch+ and delete the feature branch:
27
35
  $ git reflow deliver
28
36
 
29
37
  ----
@@ -49,6 +57,18 @@ If your code is 'LGTM'd, squash merge to +master+ and delete the feature branch:
49
57
 
50
58
  == How to use
51
59
 
60
+ === Dependencies
61
+
62
+ *Editor* When reviewing the title and body for a new pull request, or reviewing the
63
+ commit message when delivering a feature, we will open a temporary file with
64
+ your default editor. We will use git's chosen editor first ("core.editor" git config key), then we try your
65
+ "EDITOR" environment variable, and lastly we fallback on "vim".
66
+ If you would like to use an editor of your choice, we recommend setting it with
67
+ git's config. As an example, to use Atom as your editor for all git commands:
68
+ $ git config --global core.editor "atom --wait"
69
+ See GitHub's full article on [associating text editors with Git](https://help.github.com/articles/associating-text-editors-with-git/) for more information on adding this.
70
+
71
+
52
72
  === Installation
53
73
  $ gem install reflow
54
74
  or
@@ -88,6 +108,16 @@ Then for your Enterprise projects, you have to setup GitReflow for each one:
88
108
  cd replace_with_your_enterprise_project_path
89
109
  git reflow setup --enterprise --local
90
110
 
111
+ === Refreshing your current branch based on your base branch
112
+
113
+ git reflow refresh
114
+
115
+ This command updates your feature_branch and base_branch according to the remote_location and then merges your base_branch into your feature_branch. This is just a handy command to keep your branches up to date at any point in time if someone else has committed to the base_branch or the remote.
116
+
117
+ git reflow refresh -r <remote_location> -b <base_branch_name>
118
+
119
+ You pass in the name of the remote to fetch from and the name of the base_branch that you would like to merge into your feature_branch. The remote_location defaults to "origin" and the base_branch defaults to "master". This command also takes in remote and branch name as flag options.
120
+
91
121
  === Starting a feature branch
92
122
  http://reenhanced.com/reflow/git-reflow-start.gif
93
123
 
@@ -95,7 +125,14 @@ http://reenhanced.com/reflow/git-reflow-start.gif
95
125
 
96
126
  This sets up a feature branch remotely and brings a local copy to your machine. Yeah, you can do this by hand pretty easily, so skip this command if you want. This is just a handy shortcut with no magic.
97
127
 
98
- $ git reflow start nh-branch-name
128
+ git reflow start nh-branch-name
129
+
130
+ "Git Reflow Start" takes in the name of the new branch name that you want to create your feature on.
131
+ In addition, it takes in an optional flag of a base branch name. If you don't pass in this parameter, then it defaults to "master".
132
+ The base branch name is the base branch that you want to base your feature off of.
133
+ This ensures that everytime you start a new base branch, it will be based off of your latest remote base.
134
+
135
+ git reflow start nh-branch-name --base base-branch-name
99
136
 
100
137
  [PROTIP] Use your initials at the beginning of each branch so your team knows
101
138
  who is responsible for each. My initials are 'NH', so all of my branches start with +nh-+
@@ -112,9 +149,11 @@ We assume you know what you're doing, so if you need something different, do it
112
149
 
113
150
  After making commits to your branch, run +review+. Didn't push it up? We don't care, we'll do it for you.
114
151
 
115
- If you do not pass the title or message options to the review command, you will be given an editor to write your PR request in, similar to `git commit`. The first line is the title, the rest is the body.
152
+ git reflow review -t <title> -m <message>
116
153
 
117
- $ git reflow review
154
+ If you do not pass the title or message options to the review command, you will be given an editor to write your PR request commit message, similar to `git commit`. The first line is the title, the rest is the body.
155
+
156
+ $ git reflow review
118
157
 
119
158
  Review your PR:
120
159
  --------
@@ -134,13 +173,13 @@ If you do not pass the title or message options to the review command, you will
134
173
 
135
174
  Successfully created pull request #6: rj_test
136
175
  Pull Request URL: https://github.com/meesterdude/gitreflow/pull/6
137
- Would you like to open it in your browser? y
176
+ Would you like to push this branch to your remote repo and cleanup your feature branch? y
138
177
 
139
178
 
140
179
  [OSX/Ubuntu only] You can automatically open your default web browser to the pull request.
141
180
  This lets you edit the pull request with all of the detailed information you'll need before submitting it to your team.
142
181
 
143
- We output the pull request URL so you can distribute it to your team without leaving the terminal.
182
+ We output the pull request URL so you can distribute it to your team without leaving the terminal.
144
183
 
145
184
  ==== How it works
146
185
  Behind the scenes, this is how +review+ works:
@@ -177,6 +216,11 @@ This gives you details on who's reviewed your pull request. If someone has parti
177
216
  +status+ prevents you from having to open a browser to find out where your pull request is at. But in case you want to take a look, we give you the option to open it for you.
178
217
 
179
218
  === Delivering approved code
219
+
220
+ ==== Note: This documentation is for the process for the github "remote" merge process via the github_api.
221
+ For the bitbucket standard or github manual process (used when the user applies -f force flag to the "remote" merge via the github_api), please go to section B.
222
+
223
+ ==== A:
180
224
  http://reenhanced.com/reflow/git-reflow-deliver.gif
181
225
 
182
226
  git reflow deliver
@@ -186,24 +230,112 @@ You kick butt. You've got your code reviewed and now you're ready to merge it do
186
230
  Reflow's +deliver+ requires you to have a pull request, so you'll be protected on those mornings when the coffee isn't working yet.
187
231
  We built this <b>to get in your way and make you follow the process</b>. If you don't like it, do it by hand. You already know what you're doing.
188
232
 
189
- You'll be presented with a prefilled commit message based on the body of your pull request which includes the text <code>Closes #XX</code> that will automatically close the associated pull request on github when deliver completes.
233
+ You'll be presented with a prefilled commit message based on the body of your pull request with references to the pull request and reviewers.
190
234
 
191
- Make a mistake and deliver too early? It happens. You'll be prompted after you edit your commit message if you want to push your updated +master+ to github. If you answer 'n', then you'll want to do <code>git reset --hard origin/master</code> and checkout your branch again.
235
+ Want to clean up your feature branch afterwards? You'll be prompted after you edit your commit message if you want to clean up your +feature_branch+ on github. If you answer 'n', then your feature_branch will exist for you to clean it up later.
192
236
 
193
237
  This is what it looks like:
238
+
194
239
  $ git reflow deliver
240
+ Here's the status of your review:
241
+ branches: simonzhu24:test1234 -> simonzhu24:master
242
+ number: 51
243
+ reviewed by:
244
+ url: https://github.com/simonzhu24/test/pull/51
245
+
246
+ [notice] No one has reviewed your pull request.
247
+ Would you like to open it in your browser? n
248
+ This is the current status of your Pull Request. Are you sure you want to deliver? Y
249
+ Merging pull request #51: 'last commit message', from 'simonzhu24:test1234' into 'simonzhu24:master'
250
+ git checkout master
251
+ Switched to branch 'master'
252
+ Your branch is ahead of 'origin/master' by 1 commit.
253
+ (use "git push" to publish your local commits)
254
+
255
+ [success] Pull Request successfully merged.
256
+ Would you like to cleanup your feature branch? Y
257
+ git pull origin master
258
+ remote: Counting objects: 1, done.
259
+ remote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0
260
+ Unpacking objects: 100% (1/1), done.
261
+ From https://github.com/simonzhu24/test
262
+ * branch master -> FETCH_HEAD
263
+ 0d8f5e0..f853efa master -> origin/master
264
+ Updating 0b6782f..f853efa
265
+ Fast-forward
266
+ README.md | 2 +-
267
+ 1 file changed, 1 insertion(+), 1 deletion(-)
268
+
269
+ git push origin :test1234
270
+ To https://github.com/simonzhu24/test.git
271
+ - [deleted] test1234
272
+
273
+ git branch -D test1234
274
+ Deleted branch test1234 (was e130c7a).
275
+ Nice job buddy.
276
+
277
+ ==== How it works
278
+
279
+ This is what we do behind the scenes when you do +deliver+
280
+
281
+ * Does a pull request exist?
282
+
283
+ If not, stop here. You need to run +review+.
284
+
285
+ * Has the review been completed? Did we get a +LGTM+ from everyone who's participated?
286
+
287
+ If not, show a list of authors that need to provide a +LGTM+.
288
+
289
+ * If the review is done, it's time to merge. Here's what happens:
290
+
291
+ First, we use the github_api gem to merge the pull request.
292
+
293
+ We call the public API for:
294
+
295
+ github.pull_requests.merge 'user-name', 'repo-name', 'number', payload
296
+
297
+ Please take a look at lib/git_reflow/git_server/git_hub/pull_request.rb:102-107 for an example of the call.
298
+ This call makes an HTTP request using the Github API to merge the available pull request passing in the user name, repository name, pull request number, and some additional data in the payload.
299
+
300
+ The payload contains data in the following format:
301
+
302
+ data = {
303
+ "commit_title",
304
+ "commit_message",
305
+ "sha",
306
+ "squash"
307
+ }
308
+
309
+ Notice: "squash" is set to true, meaning that we will do a squash-merge for each pull request.
310
+
311
+ For more detailed documentation, please read: https://github.com/piotrmurach/github/blob/master/lib/github_api/client/pull_requests.rb#L197
312
+
313
+ * Next, we prompt you if you want to cleanup
314
+ Would you like cleanup your feature branch?
315
+
316
+ If 'y', then we'll update the +base_branch+ and delete the feature branch
317
+
318
+ git pull origin #{base_branch}
319
+ git push origin :#{feature_branch}
320
+ git branch -D #{feature_branch}
321
+
322
+ If 'n', then just stop here. The user can clean up his branch locally.
323
+
324
+ And we're done.
325
+
326
+ ==== Note: This documentation is for the bitbucket standard or github manual process (used when the user applies -f force flag to the "remote" merge via the github_api).
327
+
328
+ ==== B:
329
+ This is what the process looks like for bitbucket or if you force deliver:
330
+
195
331
  From github.com:reenhanced/gitreflow
196
332
  * branch master -> FETCH_HEAD
197
333
  Merging pull request #36: 'Enforce at least one LGTM before delivery', from 'reenhanced:nh-fail-without-lgtm' into 'reenhanced:master'
198
- Switched to branch 'master'
199
- From github.com:reenhanced/gitreflow
200
- * branch master -> FETCH_HEAD
201
334
  Already up-to-date.
202
335
  Switched to branch 'nh-fail-without-lgtm'
203
336
  Switched to branch 'master'
204
337
  Updating c2ec1b1..f90e111
205
- Fast-forward
206
- Squash commit -- not updating HEAD
338
+ Squash commit -- not updating HEAD
207
339
  lib/git_reflow.rb | 71 +++++++++++++++++++++++++++----------------------------
208
340
  1 file changed, 35 insertions(+), 36 deletions(-)
209
341
  [master d1b4dd5] Enforces LGTM before deliver, even with no comments.
@@ -222,62 +354,50 @@ This is what it looks like:
222
354
  - [deleted] nh-fail-without-lgtm
223
355
 
224
356
  Deleted branch nh-fail-without-lgtm (was f90e111).
225
- Nice job buddy.
226
-
227
- This is what the default commit message looks like:
357
+
358
+ This is what the default commit message looks like:
228
359
  Enforces LGTM before deliver, even with no comments.
229
360
  Removes the need to review the pull request yourself if you make a
230
361
  comment.
231
-
362
+
232
363
  Better error message if setup fails.
233
-
364
+
234
365
  Bug fixes.
235
-
366
+
236
367
  Closes #36
237
-
368
+
238
369
  LGTM given by: @codenamev
239
-
370
+
240
371
  Squashed commit of the following:
241
-
372
+
242
373
  commit f90e111
243
374
  Author: Nicholas Hance <nhance@reenhanced.com>
244
375
  Date: Thu Jul 11 15:33:29 2013 -0400
245
376
  ...
246
-
247
- ==== How it works
248
- This is what we do behind the scenes when you do +deliver+
249
377
 
250
- * Does a pull request exist?
378
+ If the review is done, it's time to merge. Here's what happens:
251
379
 
252
- If not, stop here. You need to run +review+.
380
+ First, update our local +master+ so we don't get conflicts
381
+ git checkout master
382
+ git pull origin master
253
383
 
254
- * Has the review been completed? Did we get a +LGTM+ from everyone who's participated?
255
-
256
- If not, show a list of authors that need to provide a +LGTM+.
257
-
258
- If the review is done, it's time to merge. Here's what happens:
384
+ Next, squash merge our feature branch
385
+ git merge --squash nh-branch-name
259
386
 
260
- First, update our local +master+ so we don't get conflicts
261
- git checkout master
262
- git pull origin master
387
+ Now, we'll apply a little magic so we have a great commit message by default. Your editor will open and you'll see a nice default for your commit message based on the pull request body.
263
388
 
264
- Next, squash merge our feature branch
265
- git merge --squash nh-branch-name
266
-
267
- Now, we'll apply a little magic so we have a great commit message by default. Your editor will open and you'll see a nice default for your commit message based on the pull request body.
389
+ Once you've saved the commit, prompt the user to see if we should continue
390
+ Merge complete!
391
+ Would you like to push this branch to your remote repo and cleanup your feature branch?
268
392
 
269
- Once you've saved the commit, prompt the user to see if we should continue
270
- Merge complete!
271
- Would you like to push this branch to your remote repo and cleanup your feature branch?
272
-
273
- If 'y', then we'll push to +master+ and delete the feature branch
274
- git push origin master
275
- git push origin :nh-branch-name
276
- git branch -D nh-branch-name
277
-
278
- If 'n', then just stop here. The user can reset his local +master+.
393
+ If 'y', then we'll push to +master+ and delete the feature branch
394
+ git pull origin master
395
+ git push origin master
396
+ git push origin :nh-branch-name
397
+ git branch -D nh-branch-name
279
398
 
280
- And we're done.
399
+ If 'n', then just stop here. The user can reset his local +master+.
400
+ And we're done.
281
401
 
282
402
  == Guiding principles:
283
403
  * Your workflow should resemble the following:
@@ -302,23 +422,30 @@ http://reenhanced.com/images/reflow.png
302
422
 
303
423
  * If you make a new commit in your branch, you require another review.
304
424
 
305
- * All participants in a pull request must approve the pull request.
306
- If 2 people comment, you need 2 'LGTM's before the code is ready to merge.
425
+ * Depending on the minimumApprovals that you specify in your ~/.gitconfig.reflow (created upon reflow setup), you can have the following:
426
+
427
+ "" : All participants in a pull request must approve the pull request.
428
+ "0": 0 approvals required for you to merge PR.
429
+ "1": You need a minimum of 1 LGTM and the last comment on your PR must be an LGTM.
430
+ "2": You need a minimum of 2 LGTM and the last comment on your PR must be an LGTM.
431
+ ...
307
432
 
308
- * Once approved, your feature branch is squash merged to master.
309
- This makes the history of the master branch extremely clean and easy to follow.
433
+ * Once approved, your feature branch is squash-merged to your base_branch.
434
+ This makes the history of the base_branch branch extremely clean and easy to follow.
310
435
 
311
436
  * Git blame becomes your friend. You'll know who to blame and can see the full context of changes.
312
- Squash commits to master mean every commit represents the whole feature, not a "typo fix".
437
+ Squash commits to base_branch mean every commit represents the whole feature, not a "typo fix".
313
438
 
314
439
 
315
440
  == Configuration
316
441
 
317
- In order to streamline delivery you can set the following git config to
318
- always push the branch after merge and clean up the feature branch.
442
+ In order to streamline delivery you can set the following git config to:
319
443
 
320
- git config --global --add "reflow.always-deploy-and-cleanup" "true"
444
+ 1. always clean up the feature branch after the PR is merged
445
+ 2. always deliver without further prompt
321
446
 
447
+ git config --global --add "reflow.always-cleanup" "true"
448
+ git config --global --add "reflow.always-deliver" "true"
322
449
 
323
450
  ---
324
451
 
data/circle.yml CHANGED
@@ -1,16 +1,16 @@
1
1
  dependencies:
2
2
  pre:
3
- - rvm install 2.0.0
4
- - rvm install 2.1.8
5
- - rvm install 2.2.4
3
+ - rvm install 2.1.10
4
+ - rvm install 2.2.5
5
+ - rvm install 2.3.1
6
6
 
7
7
  override:
8
- - 'rvm-exec 2.0.0-p648 bundle install'
9
- - 'rvm-exec 2.1.8 bundle install'
10
- - 'rvm-exec 2.2.4 bundle install'
8
+ - 'rvm-exec 2.1.10 bundle install'
9
+ - 'rvm-exec 2.2.5 bundle install'
10
+ - 'rvm-exec 2.3.1 bundle install'
11
11
 
12
12
  test:
13
13
  override:
14
- - 'rvm-exec 2.0.0-p648 bundle exec rake'
15
- - 'rvm-exec 2.1.8 bundle exec rake'
16
- - 'rvm-exec 2.2.4 bundle exec rake'
14
+ - 'rvm-exec 2.1.10 bundle exec rake'
15
+ - 'rvm-exec 2.2.5 bundle exec rake'
16
+ - 'rvm-exec 2.3.1 bundle exec rake'