git_reflow 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2437a3ef9ef77a60350a4ee9c85a27c7b30f08ba
4
- data.tar.gz: b7f81b792a331bc0466eb12b7a733bbd754fe562
3
+ metadata.gz: c0120e898073e422bc4c2203dadfb71f60de083b
4
+ data.tar.gz: bf8b82ecaccfe531f2ef87d9882ac794597352e4
5
5
  SHA512:
6
- metadata.gz: 94cf313fc46c9c1e5f38f6fff7e3d732b93acbf2c852c321525882af32236e19fc16b868e413901cbd229a7e183e99e26eae7165ed543437dd48780265c5e8f7
7
- data.tar.gz: f1e9d43de78984a88340ea76b58c35167f28d987de03b0904b0557aed7b6855ba0ea71d45e66fe1a679cc56323ad7a7813c5db29165c5861c19ce30c6fcab806
6
+ metadata.gz: 4647f117605853e151a65147b5ffffdcfee3a5abcf66e699fe0c6512d847da0d3ec2df0a96f48927395362227d933b52a926dc17e6abc52c023d9b671a005721
7
+ data.tar.gz: 5b6724e334fc187b4c1d6dc7ccd76b7e3db4155955644f46f24df5932872e7e78b6e44061c9e95e40a6be91c6c7a80bccfc8d22069d5ec4d5d54bb5a037aa212
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git_reflow (0.5.3)
4
+ git_reflow (0.6.0)
5
5
  colorize (= 0.6.0)
6
6
  github_api (= 0.12.3)
7
7
  gli (= 2.12.2)
@@ -43,10 +43,10 @@ GEM
43
43
  oauth2
44
44
  gli (2.12.2)
45
45
  hashie (3.4.1)
46
- highline (1.7.1)
46
+ highline (1.7.2)
47
47
  httpclient (2.6.0.1)
48
48
  json_pure (1.8.2)
49
- jwt (1.4.1)
49
+ jwt (1.5.0)
50
50
  method_source (0.8.2)
51
51
  mini_portile (0.6.2)
52
52
  multi_json (1.11.0)
@@ -67,7 +67,7 @@ GEM
67
67
  pry-byebug (3.1.0)
68
68
  byebug (~> 4.0)
69
69
  pry (~> 0.10)
70
- rack (1.6.0)
70
+ rack (1.6.1)
71
71
  rake (10.4.2)
72
72
  rb-readline (0.5.2)
73
73
  rdoc (4.2.0)
data/README.rdoc CHANGED
@@ -108,26 +108,35 @@ We assume you know what you're doing, so if you need something different, do it
108
108
 
109
109
  After making commits to your branch, run +review+. Didn't push it up? We don't care, we'll do it for you.
110
110
 
111
- $ git reflow review
111
+ 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.
112
112
 
113
- From github.com:reenhanced/gitreflow
113
+ $ git reflow review
114
+
115
+ Review your PR:
116
+ --------
117
+ Title:
118
+ rj_209_test
119
+
120
+ Body:
121
+ [lib] updates review command to address issues
122
+ --------
123
+ Submit pull request? (Y): <enter>
124
+ git fetch origin master
125
+ From github.com:meesterdude/gitreflow
114
126
  * branch master -> FETCH_HEAD
115
- Counting objects: 5, done.
116
- Delta compression using up to 16 threads.
117
- Compressing objects: 100% (3/3), done.
118
- Writing objects: 100% (3/3), 1.68 KiB, done.
119
- Total 3 (delta 1), reused 0 (delta 0)
120
- To git@github.com:reenhanced/gitreflow.git
121
- c2ec1b1..1103006 nh-readme-update -> nh-readme-update
122
127
 
123
- Successfully created pull request #35: Bootstrapping the readme. This is so I can show how review works
124
- Pull Request URL: https://github.com/reenhanced/gitreflow/pull/35
128
+ git push origin rj_test
129
+ Everything up-to-date
130
+
131
+ Successfully created pull request #6: rj_test
132
+ Pull Request URL: https://github.com/meesterdude/gitreflow/pull/6
125
133
  Would you like to open it in your browser? y
126
134
 
135
+
127
136
  [OSX/Ubuntu only] You can automatically open your default web browser to the pull request.
128
137
  This lets you edit the pull request with all of the detailed information you'll need before submitting it to your team.
129
138
 
130
- We output the pull request URL so you can distribute it to your team without leaving the terminal. But don't be a jerk, update the title and description before you send your work around.
139
+ We output the pull request URL so you can distribute it to your team without leaving the terminal.
131
140
 
132
141
  ==== How it works
133
142
  Behind the scenes, this is how +review+ works:
@@ -6,15 +6,34 @@ command :review do |c|
6
6
  c.flag [:t, :title], default_value: 'last commit message'
7
7
  c.flag [:m, :message], default_value: 'title'
8
8
  c.action do |global_options,options,args|
9
- review_options = {
10
- 'base' => args[0],
11
- 'title' => global_options[:title],
12
- 'body' => global_options[:message]
13
- }
9
+ git_root_dir = run('git rev-parse --show-toplevel').strip
10
+ pull_request_msg_file = "#{git_root_dir}/.git/GIT_REFLOW_PR_MSG"
14
11
 
15
- review_options['title'] ||= GitReflow.get_first_commit_message
16
- review_options['body'] ||= review_options['title']
12
+ if global_options[:title] || global_options[:message]
13
+ review_options = {
14
+ 'base' => args[0],
15
+ 'title' => (global_options[:title] || GitReflow.current_branch),
16
+ 'body' => global_options[:message]
17
+ }
18
+ else
19
+ File.open(pull_request_msg_file, 'w') do |file|
20
+ file.write(GitReflow.current_branch)
21
+ end
22
+ GitReflow.run("$EDITOR #{pull_request_msg_file}", with_system: true)
23
+ pr_msg = File.open(pull_request_msg_file).each_line.map(&:strip).to_a
24
+ File.delete(pull_request_msg_file)
25
+ title = pr_msg.shift
26
+ unless pr_msg.empty?
27
+ pr_msg.shift if pr_msg.first.empty?
28
+ end
29
+ review_options = {'base' => args[0],'title' => title,'body' => pr_msg.join("\n")}
30
+ end
17
31
 
18
- GitReflow.review review_options
32
+ puts "\nReview your PR:\n"
33
+ puts "--------\n"
34
+ puts "Title:\n#{review_options['title']}\n\n"
35
+ puts "Body:\n#{review_options['body']}\n"
36
+ puts "--------\n"
37
+ GitReflow.review(review_options) unless ask("Submit pull request? (Y)") =~ /n/i
19
38
  end
20
39
  end
@@ -1,3 +1,3 @@
1
1
  module GitReflow
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_reflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentino Stoll