hub 1.10.4 → 1.10.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of hub might be problematic. Click here for more details.

data/HISTORY.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.10.5 (2013-03-02)
2
+
3
+ * helpful `pull-request` error message when base project is invalid
4
+ * fix `compare` for ranges containing "owner:branch" notation
5
+ * enable `--name` argument for `submodule add`
6
+
1
7
  ## 1.10.4 (2012-12-29)
2
8
 
3
9
  * fixes for Windows
data/README.md CHANGED
@@ -332,8 +332,8 @@ superpowers:
332
332
  $ hub submodule add -p wycats/bundler vendor/bundler
333
333
  > git submodule add git@github.com:wycats/bundler.git vendor/bundler
334
334
 
335
- $ hub submodule add -b ryppl ryppl/pip vendor/pip
336
- > git submodule add -b ryppl git://github.com/ryppl/pip.git vendor/pip
335
+ $ hub submodule add -b ryppl --name pip ryppl/pip vendor/pip
336
+ > git submodule add -b ryppl --name pip git://github.com/ryppl/pip.git vendor/pip
337
337
 
338
338
 
339
339
  ### git help
data/Rakefile CHANGED
@@ -152,12 +152,12 @@ task :homebrew do
152
152
  sh 'git pull -q origin master'
153
153
 
154
154
  formula_file = 'Library/Formula/hub.rb'
155
- md5 = `curl -#L https://github.com/defunkt/hub/tarball/v#{Hub::VERSION} | md5`.chomp
156
- abort unless $?.success? and md5.length == 32
155
+ sha = `curl -#L https://github.com/defunkt/hub/tarball/v#{Hub::VERSION} | shasum`.split(/\s+/).first
156
+ abort unless $?.success? and sha.length == 40
157
157
 
158
158
  formula = File.read formula_file
159
159
  formula.sub! /\bv\d+(\.\d+)*/, "v#{Hub::VERSION}"
160
- formula.sub! /\b[0-9a-f]{32}\b/, md5
160
+ formula.sub! /\b[0-9a-f]{40}\b/, sha
161
161
  File.open(formula_file, 'w') {|f| f << formula }
162
162
 
163
163
  branch = "hub-v#{Hub::VERSION}"
@@ -185,7 +185,12 @@ module Hub
185
185
  args.executable = 'echo'
186
186
  args.replace [pull['html_url']]
187
187
  rescue GitHubAPI::Exceptions
188
- display_api_exception("creating pull request", $!.response)
188
+ response = $!.response
189
+ display_api_exception("creating pull request", response)
190
+ if 404 == response.status
191
+ base_url = base_project.web_url.split('://', 2).last
192
+ warn "Are you sure that #{base_url} exists?"
193
+ end
189
194
  exit 1
190
195
  end
191
196
 
@@ -202,7 +207,7 @@ module Hub
202
207
  # > git clone git@github.com:YOUR_LOGIN/hemingway.git
203
208
  def clone(args)
204
209
  ssh = args.delete('-p')
205
- has_values = /^(--(upload-pack|template|depth|origin|branch|reference)|-[ubo])$/
210
+ has_values = /^(--(upload-pack|template|depth|origin|branch|reference|name)|-[ubo])$/
206
211
 
207
212
  idx = 1
208
213
  while idx < args.length
@@ -231,23 +236,13 @@ module Hub
231
236
  # $ hub submodule add -p wycats/bundler vendor/bundler
232
237
  # > git submodule add git@github.com:wycats/bundler.git vendor/bundler
233
238
  #
234
- # $ hub submodule add -b ryppl ryppl/pip vendor/bundler
235
- # > git submodule add -b ryppl git://github.com/ryppl/pip.git vendor/pip
239
+ # $ hub submodule add -b ryppl --name pip ryppl/pip vendor/pip
240
+ # > git submodule add -b ryppl --name pip git://github.com/ryppl/pip.git vendor/pip
236
241
  def submodule(args)
237
242
  return unless index = args.index('add')
238
243
  args.delete_at index
239
244
 
240
- branch = args.index('-b') || args.index('--branch')
241
- if branch
242
- args.delete_at branch
243
- branch_name = args.delete_at branch
244
- end
245
-
246
245
  clone(args)
247
-
248
- if branch_name
249
- args.insert branch, '-b', branch_name
250
- end
251
246
  args.insert index, 'add'
252
247
  end
253
248
 
@@ -635,7 +630,7 @@ module Hub
635
630
  abort "Usage: hub compare [USER] [<START>...]<END>"
636
631
  end
637
632
  else
638
- sha_or_tag = /(\w{1,2}|\w[\w.-]+\w)/
633
+ sha_or_tag = /((?:#{OWNER_RE}:)?\w[\w.-]+\w)/
639
634
  # replaces two dots with three: "sha1...sha2"
640
635
  range = args.pop.sub(/^#{sha_or_tag}\.\.#{sha_or_tag}$/, '\1...\2')
641
636
  project = if owner = args.pop then github_project(nil, owner)
@@ -1,3 +1,3 @@
1
1
  module Hub
2
- Version = VERSION = '1.10.4'
2
+ Version = VERSION = '1.10.5'
3
3
  end
data/man/hub.1 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "HUB" "1" "November 2012" "DEFUNKT" "Git Manual"
4
+ .TH "HUB" "1" "March 2013" "DEFUNKT" "Git Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBhub\fR \- git + hub = github
@@ -425,8 +425,8 @@ $ hub submodule add wycats/bundler vendor/bundler
425
425
  $ hub submodule add \-p wycats/bundler vendor/bundler
426
426
  > git submodule add git@github\.com:wycats/bundler\.git vendor/bundler
427
427
 
428
- $ hub submodule add \-b ryppl ryppl/pip vendor/pip
429
- > git submodule add \-b ryppl git://github\.com/ryppl/pip\.git vendor/pip
428
+ $ hub submodule add \-b ryppl \-\-name pip ryppl/pip vendor/pip
429
+ > git submodule add \-b ryppl \-\-name pip git://github\.com/ryppl/pip\.git vendor/pip
430
430
  .
431
431
  .fi
432
432
  .
@@ -411,8 +411,8 @@ $ git compare other-user patch
411
411
  $ hub submodule add -p wycats/bundler vendor/bundler
412
412
  &gt; git submodule add git@github.com:wycats/bundler.git vendor/bundler
413
413
 
414
- $ hub submodule add -b ryppl ryppl/pip vendor/pip
415
- &gt; git submodule add -b ryppl git://github.com/ryppl/pip.git vendor/pip
414
+ $ hub submodule add -b ryppl --name pip ryppl/pip vendor/pip
415
+ &gt; git submodule add -b ryppl --name pip git://github.com/ryppl/pip.git vendor/pip
416
416
  </code></pre>
417
417
 
418
418
  <h3 id="git-help">git help</h3>
@@ -440,7 +440,7 @@ $ git help hub
440
440
 
441
441
  <ol class='man-decor man-foot man foot'>
442
442
  <li class='tl'>DEFUNKT</li>
443
- <li class='tc'>November 2012</li>
443
+ <li class='tc'>March 2013</li>
444
444
  <li class='tr'>hub(1)</li>
445
445
  </ol>
446
446
 
@@ -525,66 +525,6 @@ class HubTest < Test::Unit::TestCase
525
525
  assert_includes 'This file is generated code', hub("hub standalone")
526
526
  end
527
527
 
528
- def test_hub_compare
529
- assert_command "compare refactor",
530
- "open https://github.com/defunkt/hub/compare/refactor"
531
- end
532
-
533
- def test_hub_compare_nothing
534
- expected = "Usage: hub compare [USER] [<START>...]<END>\n"
535
- assert_equal expected, hub("compare")
536
- end
537
-
538
- def test_hub_compare_tracking_nothing
539
- stub_tracking_nothing
540
- expected = "Usage: hub compare [USER] [<START>...]<END>\n"
541
- assert_equal expected, hub("compare")
542
- end
543
-
544
- def test_hub_compare_tracking_branch
545
- stub_branch('refs/heads/feature')
546
- stub_tracking('feature', 'mislav', 'experimental')
547
-
548
- assert_command "compare",
549
- "open https://github.com/mislav/hub/compare/experimental"
550
- end
551
-
552
- def test_hub_compare_range
553
- assert_command "compare 1.0...fix",
554
- "open https://github.com/defunkt/hub/compare/1.0...fix"
555
- end
556
-
557
- def test_hub_compare_range_fixes_two_dots_for_tags
558
- assert_command "compare 1.0..fix",
559
- "open https://github.com/defunkt/hub/compare/1.0...fix"
560
- end
561
-
562
- def test_hub_compare_range_fixes_two_dots_for_shas
563
- assert_command "compare 1234abc..3456cde",
564
- "open https://github.com/defunkt/hub/compare/1234abc...3456cde"
565
- end
566
-
567
- def test_hub_compare_range_ignores_two_dots_for_complex_ranges
568
- assert_command "compare @{a..b}..@{c..d}",
569
- "open https://github.com/defunkt/hub/compare/@{a..b}..@{c..d}"
570
- end
571
-
572
- def test_hub_compare_on_wiki
573
- stub_repo_url 'git://github.com/defunkt/hub.wiki.git'
574
- assert_command "compare 1.0...fix",
575
- "open https://github.com/defunkt/hub/wiki/_compare/1.0...fix"
576
- end
577
-
578
- def test_hub_compare_fork
579
- assert_command "compare myfork feature",
580
- "open https://github.com/myfork/hub/compare/feature"
581
- end
582
-
583
- def test_hub_compare_url
584
- assert_command "compare -u 1.0...1.1",
585
- "echo https://github.com/defunkt/hub/compare/1.0...1.1"
586
- end
587
-
588
528
  def test_hub_browse_no_repo
589
529
  stub_repo_url(nil)
590
530
  assert_equal "Usage: hub browse [<USER>/]<REPOSITORY>\n", hub("browse")
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.4
5
4
  prerelease:
5
+ version: 1.10.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Wanstrath
@@ -10,35 +10,35 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-29 00:00:00.000000000 Z
13
+ date: 2013-03-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rake
17
- requirement: !ruby/object:Gem::Requirement
16
+ prerelease: false
17
+ type: :development
18
+ version_requirements: !ruby/object:Gem::Requirement
18
19
  none: false
19
20
  requirements:
20
21
  - - ! '>='
21
22
  - !ruby/object:Gem::Version
22
23
  version: '0'
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
24
+ name: rake
25
+ requirement: !ruby/object:Gem::Requirement
26
26
  none: false
27
27
  requirements:
28
28
  - - ! '>='
29
29
  - !ruby/object:Gem::Version
30
30
  version: '0'
31
31
  - !ruby/object:Gem::Dependency
32
- name: webmock
33
- requirement: !ruby/object:Gem::Requirement
32
+ prerelease: false
33
+ type: :development
34
+ version_requirements: !ruby/object:Gem::Requirement
34
35
  none: false
35
36
  requirements:
36
37
  - - ! '>='
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
- type: :development
40
- prerelease: false
41
- version_requirements: !ruby/object:Gem::Requirement
40
+ name: webmock
41
+ requirement: !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ! '>='
@@ -110,4 +110,3 @@ signing_key:
110
110
  specification_version: 3
111
111
  summary: Command-line wrapper for git and GitHub
112
112
  test_files: []
113
- has_rdoc: