gitcycle 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -115,14 +115,13 @@ If you are working in a fork, it is easy to track upstream branches:
115
115
  Todo
116
116
  ----
117
117
 
118
- * Instead of detecting CONFLICT, use error status $? != 0
119
- * Add comment on lighthouse with issue URL
120
- * Label issues with ticket milestone?
121
- * gitc qa pass, should not set ticket to pending-approval if its already resolved
122
- * gitc pull before gitc ready
118
+ * Fix git fatal error (related to pull?)
119
+ * On pass or fail, send email to Github email
120
+ * Change QA branch name to qa_login_branch
123
121
  * Note you can use gitc with a string
124
122
  * Tag issue with Lighthouse tags (if == backend or frontend)
125
- * On pass or fail, send email to Github email
123
+ * gitc qa pass, should not set ticket to pending-approval if its already resolved
126
124
  * If gitc reset happens on branch with Github issue, close the existing issue
127
- * Change QA branch name to qa_login_branch
128
- * LH states aren't being updated to pending-* states, the active state update works, reported by Jimmy
125
+ * Add comment on lighthouse with issue URL
126
+ * Instead of detecting CONFLICT, use error status $? != 0
127
+ * Label issues with ticket milestone?
@@ -32,9 +32,9 @@ Scenario: Feature branch w/ custom branch name
32
32
  Would you like to name your branch 'ticket.id'? (y/n)
33
33
  What would you like to name your branch?
34
34
  Adding remote repo 'config.owner/config.repo'.
35
- Fetching remote repo 'config.owner/config.repo'.
35
+ Fetching remote 'config.owner'.
36
36
  Checking out remote branch 'ticket.id-rename' from 'config.owner/config.repo/master'.
37
- Pulling 'origin/ticket.id-rename'.
37
+ Fetching remote 'origin'.
38
38
  Pushing 'origin/ticket.id-rename'.
39
39
  Sending branch information to gitcycle.
40
40
  """
@@ -54,9 +54,9 @@ Scenario: Feature branch
54
54
  Your work will eventually merge into 'master'. Is this correct? (y/n)
55
55
  Would you like to name your branch 'ticket.id'? (y/n)
56
56
  Adding remote repo 'config.owner/config.repo'.
57
- Fetching remote repo 'config.owner/config.repo'.
57
+ Fetching remote 'config.owner'.
58
58
  Checking out remote branch 'ticket.id' from 'config.owner/config.repo/master'.
59
- Pulling 'origin/ticket.id'.
59
+ Fetching remote 'origin'.
60
60
  Pushing 'origin/ticket.id'.
61
61
  Sending branch information to gitcycle.
62
62
  """
@@ -75,8 +75,9 @@ Scenario: Reset feature branch
75
75
  Your work will eventually merge into 'master'. Is this correct? (y/n)
76
76
  Would you like to name your branch 'ticket.id'? (y/n)
77
77
  Adding remote repo 'config.owner/config.repo'.
78
- Fetching remote repo 'config.owner/config.repo'.
78
+ Fetching remote 'config.owner'.
79
79
  Checking out remote branch 'ticket.id' from 'config.owner/config.repo/master'.
80
+ Fetching remote 'origin'.
80
81
  Pulling 'origin/ticket.id'.
81
82
  Pushing 'origin/ticket.id'.
82
83
  Sending branch information to gitcycle.
@@ -118,7 +119,7 @@ Scenario: Pull changes from upstream
118
119
  """
119
120
  Retrieving branch information from gitcycle.
120
121
  Adding remote repo 'config.owner/config.repo'.
121
- Fetching remote repo 'config.owner/config.repo'.
122
+ Fetching remote 'config.owner'.
122
123
  Merging remote branch 'master' from 'config.owner/config.repo'.
123
124
  """
124
125
  And git log should contain the last commit
@@ -168,7 +169,15 @@ Scenario: Ready issue w/ no parameters
168
169
  And I checkout ticket.id
169
170
  And I execute gitcycle with "ready"
170
171
  Then gitcycle runs
171
- And output includes "Labeling issue as 'Pending Review'."
172
+ And output includes
173
+ """
174
+ Retrieving branch information from gitcycle.
175
+ Adding remote repo 'config.owner/config.repo'.
176
+ Fetching remote 'config.owner'.
177
+ Merging remote branch 'master' from 'config.owner/config.repo'.
178
+ Retrieving branch information from gitcycle.
179
+ Labeling issue as 'Pending Review'.
180
+ """
172
181
 
173
182
  Scenario: Ready issue w/ parameters
174
183
  When I cd to the user repo
@@ -199,12 +208,12 @@ Scenario: QA issue
199
208
  Retrieving branch information from gitcycle.
200
209
  Deleting old QA branch 'qa_master'.
201
210
  Adding remote repo 'config.owner/config.repo'.
202
- Fetching remote repo 'config.owner/config.repo'.
211
+ Fetching remote 'config.owner'.
203
212
  Checking out remote branch 'qa_master' from 'config.owner/config.repo/master'.
204
- Pulling 'origin/qa_master'.
213
+ Fetching remote 'origin'.
205
214
  Pushing 'origin/qa_master'.
206
215
  Adding remote repo 'config.user/config.repo'.
207
- Fetching remote repo 'config.user/config.repo'.
216
+ Fetching remote 'config.user'.
208
217
  Merging remote branch 'ticket.id' from 'config.user/config.repo'.
209
218
  Pushing branch 'qa_master'.
210
219
  Type 'gitc qa pass' to approve all issues in this branch.
@@ -219,5 +228,5 @@ Scenario: QA issue list
219
228
  And output includes
220
229
  """
221
230
  qa_master
222
- issue #issue.id config.user/ticket.id
231
+ issue #issue.id\tconfig.user/ticket.id
223
232
  """
@@ -200,7 +200,7 @@ Then /^output includes \"([^\"]*)" with URL$/ do |expected|
200
200
  end
201
201
 
202
202
  Then /^output includes$/ do |expected|
203
- expected = gsub_variables(expected)
203
+ expected = gsub_variables(expected).gsub('\t', "\t")
204
204
  @output.gsub(/\n+/, "\n").include?(expected).should == true
205
205
  end
206
206
 
data/gitcycle.gemspec CHANGED
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "gitcycle"
9
- s.version = '0.1.15'
9
+ s.version = '0.1.16'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = [ 'Winton Welsh' ]
12
12
  s.email = [ 'mail@wintoni.us' ]
data/lib/gitcycle.rb CHANGED
@@ -261,6 +261,7 @@ class Gitcycle
261
261
  require_git && require_config
262
262
 
263
263
  if issues.empty?
264
+ pull
264
265
  branch = create_pull_request
265
266
 
266
267
  if branch == false
@@ -365,12 +366,12 @@ class Gitcycle
365
366
  run("git remote add #{owner} git@github.com:#{owner}/#{repo}.git")
366
367
  end
367
368
 
368
- puts "Fetching remote repo '#{owner}/#{repo}'.\n".green
369
+ puts "Fetching remote '#{owner}'.\n".green
369
370
  run("git fetch -q #{owner}")
370
371
  end
371
372
 
372
373
  def branches(options={})
373
- b = `git branch#{" -a" if options[:all]}`
374
+ b = `git branch#{" -a" if options[:all]}#{" -r" if options[:remote]}`
374
375
  if options[:current]
375
376
  b.match(/\*\s+(.+)/)[1]
376
377
  elsif options[:match]
@@ -390,7 +391,7 @@ class Gitcycle
390
391
  else
391
392
  puts "Tracking branch '#{remote}/#{name}'.\n".green
392
393
  run("git fetch -q #{remote}")
393
- run("git checkout -b #{name} #{remote}/#{name}")
394
+ run("git checkout --track -b #{name} #{remote}/#{name}")
394
395
  end
395
396
 
396
397
  run("git pull #{remote} #{name}")
@@ -416,10 +417,15 @@ class Gitcycle
416
417
  add_remote_and_fetch(options)
417
418
 
418
419
  puts "Checking out remote branch '#{target}' from '#{owner}/#{repo}/#{branch}'.\n".green
419
- run("git checkout -b #{target} #{owner}/#{branch}")
420
+ run("git checkout --track -b #{target} #{owner}/#{branch}")
420
421
 
421
- puts "Pulling 'origin/#{target}'.\n".green
422
- run("git pull origin #{target}")
422
+ puts "Fetching remote 'origin'.\n".green
423
+ run("git fetch -q origin")
424
+
425
+ if branches(:remote => true, :match => "origin/#{target}")
426
+ puts "Pulling 'origin/#{target}'.\n".green
427
+ run("git pull origin #{target}")
428
+ end
423
429
 
424
430
  puts "Pushing 'origin/#{target}'.\n".green
425
431
  run("git push origin #{target}")
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitcycle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 15
10
- version: 0.1.15
9
+ - 16
10
+ version: 0.1.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-27 00:00:00 -08:00
18
+ date: 2012-01-29 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency