hub 1.11.1 → 1.11.2

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.

@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 33425262679ba4de3ce4878fc66c286f6d25ef3b
4
+ data.tar.gz: 521fb0f37a0ee0d416952ced4d411b6b59812283
5
+ SHA512:
6
+ metadata.gz: 57892fa9c30df8535ad45f3add227a01ceb5914b6886b77562ec7a3fd4e876885f0fb4e2087659673017c7cfa0fec2675c23fd873c7152f2991b243474b5bfb1
7
+ data.tar.gz: 372b734e8ad6ea150dde927387fda9d3d3b0957574e50800c2806d5b1f58c2385734efd97d5170c280ecf231325d596c9f1de0206b32a0da0ef012d09a51251a
data/Rakefile CHANGED
@@ -115,6 +115,7 @@ task :install => "hub" do
115
115
  FileUtils.cp 'hub', bindir
116
116
  else
117
117
  prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
118
+ prefix = File.join(ENV["DESTDIR"], prefix) if ENV["DESTDIR"]
118
119
 
119
120
  FileUtils.mkdir_p "#{prefix}/bin"
120
121
  FileUtils.cp "hub", "#{prefix}/bin", :preserve => true
@@ -556,8 +556,10 @@ module Hub
556
556
  if args.include?('--no-remote')
557
557
  exit
558
558
  else
559
+ origin_url = project.remote.github_url
559
560
  url = forked_project.git_url(:private => true, :https => https_protocol?)
560
- args.replace %W"remote add -f #{forked_project.owner} #{url}"
561
+ args.replace %W"remote add -f #{forked_project.owner} #{origin_url}"
562
+ args.after %W"remote set-url #{forked_project.owner} #{url}"
561
563
  args.after 'echo', ['new remote:', forked_project.owner]
562
564
  end
563
565
  rescue GitHubAPI::Exceptions
@@ -662,22 +664,27 @@ module Hub
662
664
  browse_command(args) do
663
665
  dest = args.shift
664
666
  dest = nil if dest == '--'
667
+ # $ hub browse -- wiki
668
+ subpage = args.shift
665
669
 
666
670
  if dest
667
671
  # $ hub browse pjhyett/github-services
668
672
  # $ hub browse github-services
669
673
  project = github_project dest
670
674
  branch = master_branch
675
+ elsif subpage && !%w[commits tree blob settings].include?(subpage)
676
+ branch = master_branch
677
+ project = local_repo.main_project
671
678
  else
672
679
  # $ hub browse
673
- branch, project = remote_branch_and_project(method(:github_user))
680
+ prefer_upstream = current_branch.master?
681
+ branch, project = remote_branch_and_project(method(:github_user), prefer_upstream)
674
682
  branch ||= master_branch
675
683
  end
676
684
 
677
685
  abort "Usage: hub browse [<USER>/]<REPOSITORY>" unless project
678
686
 
679
- # $ hub browse -- wiki
680
- path = case subpage = args.shift
687
+ path = case subpage
681
688
  when 'commits'
682
689
  "/commits/#{branch_in_url(branch)}"
683
690
  when 'tree', NilClass
@@ -717,7 +724,7 @@ module Hub
717
724
  end
718
725
  end
719
726
 
720
- project.web_url "/compare/#{range}"
727
+ project.web_url "/compare/#{range.tr('/', ';')}"
721
728
  end
722
729
  end
723
730
 
@@ -998,7 +1005,7 @@ help
998
1005
  # included after the __END__ of the file so we can grab it using
999
1006
  # DATA.
1000
1007
  def hub_raw_manpage
1001
- if File.exists? file = File.dirname(__FILE__) + '/../../man/hub.1'
1008
+ if File.exist? file = File.dirname(__FILE__) + '/../../man/hub.1'
1002
1009
  File.read(file)
1003
1010
  else
1004
1011
  DATA.read
@@ -1085,7 +1092,7 @@ help
1085
1092
  # the pullrequest_editmsg_file, which newer hub would pick up and
1086
1093
  # misinterpret as a message which should be reused after a failed PR.
1087
1094
  def valid_editmsg_file?(message_file)
1088
- File.exists?(message_file) &&
1095
+ File.exist?(message_file) &&
1089
1096
  File.mtime(message_file) > File.mtime(__FILE__)
1090
1097
  end
1091
1098
 
@@ -1102,7 +1109,7 @@ help
1102
1109
  File.open(file, 'r') { |msg|
1103
1110
  msg.each_line do |line|
1104
1111
  next if line.index('#') == 0
1105
- ((body.empty? and line =~ /\S/) ? title : body) << line
1112
+ ((title.empty? and line =~ /\S/) ? title : body) << line
1106
1113
  end
1107
1114
  }
1108
1115
  title.tr!("\n", ' ')
@@ -152,10 +152,10 @@ module Hub
152
152
  remote = origin_remote and remote.project
153
153
  end
154
154
 
155
- def remote_branch_and_project(username_fetcher)
155
+ def remote_branch_and_project(username_fetcher, prefer_upstream = false)
156
156
  project = main_project
157
157
  if project and branch = current_branch
158
- branch = branch.push_target(username_fetcher.call(project.host))
158
+ branch = branch.push_target(username_fetcher.call(project.host), prefer_upstream)
159
159
  project = remote_by_name(branch.remote_name).project if branch && branch.remote?
160
160
  end
161
161
  [branch, project]
@@ -219,7 +219,7 @@ module Hub
219
219
  end
220
220
 
221
221
  def origin_remote
222
- remotes.first
222
+ remotes.detect {|r| r.urls.any? }
223
223
  end
224
224
 
225
225
  def remote_by_name(remote_name)
@@ -356,7 +356,7 @@ module Hub
356
356
  end
357
357
  end
358
358
 
359
- def push_target(owner_name)
359
+ def push_target(owner_name, prefer_upstream = false)
360
360
  push_default = local_repo.git_config('push.default')
361
361
  if %w[upstream tracking].include?(push_default)
362
362
  upstream
@@ -365,6 +365,7 @@ module Hub
365
365
  refs = local_repo.remotes_for_publish(owner_name).map { |remote|
366
366
  "refs/remotes/#{remote}/#{short}"
367
367
  }
368
+ refs.reverse! if prefer_upstream
368
369
  if branch = refs.detect {|ref| local_repo.file_exist?(ref) }
369
370
  Branch.new(local_repo, branch)
370
371
  end
@@ -397,6 +398,10 @@ module Hub
397
398
  nil
398
399
  end
399
400
 
401
+ def github_url
402
+ urls.detect {|url| local_repo.known_host?(url.host) }
403
+ end
404
+
400
405
  def urls
401
406
  @urls ||= raw_urls.map do |url|
402
407
  with_normalized_url(url) do |normalized|
@@ -405,7 +410,7 @@ module Hub
405
410
  rescue URI::InvalidURIError
406
411
  end
407
412
  end
408
- end
413
+ end.compact
409
414
  end
410
415
 
411
416
  def with_normalized_url(url)
@@ -1,3 +1,3 @@
1
1
  module Hub
2
- Version = VERSION = '1.11.1'
2
+ Version = VERSION = '1.11.2'
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.11.1
4
+ version: 1.11.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Chris Wanstrath
@@ -10,22 +9,37 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-12-26 00:00:00.000000000 Z
12
+ date: 2014-02-02 00:00:00.000000000 Z
14
13
  dependencies: []
15
- description: ! " `hub` is a command line utility which adds GitHub knowledge to `git`.\n\n
16
- \ It can used on its own or as a `git` wrapper.\n\n Normal:\n\n $ hub clone
17
- rtomayko/tilt\n\n Expands to:\n $ git clone git://github.com/rtomayko/tilt.git\n\n
18
- \ Wrapping `git`:\n\n $ git clone rack/rack\n\n Expands to:\n $ git
19
- clone git://github.com/rack/rack.git\n"
14
+ description: |2
15
+ `hub` is a command line utility which adds GitHub knowledge to `git`.
16
+
17
+ It can used on its own or as a `git` wrapper.
18
+
19
+ Normal:
20
+
21
+ $ hub clone rtomayko/tilt
22
+
23
+ Expands to:
24
+ $ git clone git://github.com/rtomayko/tilt.git
25
+
26
+ Wrapping `git`:
27
+
28
+ $ git clone rack/rack
29
+
30
+ Expands to:
31
+ $ git clone git://github.com/rack/rack.git
20
32
  email: mislav.marohnic@gmail.com
21
33
  executables:
22
34
  - hub
23
35
  extensions: []
24
36
  extra_rdoc_files: []
25
37
  files:
38
+ - LICENSE
26
39
  - README.md
27
40
  - Rakefile
28
- - LICENSE
41
+ - bin/hub
42
+ - lib/hub.rb
29
43
  - lib/hub/args.rb
30
44
  - lib/hub/commands.rb
31
45
  - lib/hub/context.rb
@@ -36,39 +50,50 @@ files:
36
50
  - lib/hub/ssh_config.rb
37
51
  - lib/hub/standalone.rb
38
52
  - lib/hub/version.rb
39
- - lib/hub.rb
40
- - bin/hub
41
53
  - man/hub.1
42
54
  - man/hub.1.html
43
55
  - man/hub.1.ronn
44
56
  homepage: http://hub.github.com/
45
57
  licenses:
46
58
  - MIT
47
- post_install_message: ! "\n------------------------------------------------------------\n\n
48
- \ You there! Wait, I say!\n =======================\n\n
49
- \ If you are a heavy user of `git` on the command\n line you may want
50
- \ to install `hub` the old\n fashioned way. Faster startup time, you
51
- see.\n\n Check out the installation instructions at\n https://github.com/github/hub#readme
52
- \ under the\n \"Standalone\" section.\n\n Cheers,\n defunkt\n\n------------------------------------------------------------\n\n"
59
+ metadata: {}
60
+ post_install_message: |2+
61
+
62
+ ------------------------------------------------------------
63
+
64
+ You there! Wait, I say!
65
+ =======================
66
+
67
+ If you are a heavy user of `git` on the command
68
+ line you may want to install `hub` the old
69
+ fashioned way. Faster startup time, you see.
70
+
71
+ Check out the installation instructions at
72
+ https://github.com/github/hub#readme under the
73
+ "Standalone" section.
74
+
75
+ Cheers,
76
+ defunkt
77
+
78
+ ------------------------------------------------------------
79
+
53
80
  rdoc_options: []
54
81
  require_paths:
55
82
  - lib
56
83
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
84
  requirements:
59
- - - ! '>='
85
+ - - ">="
60
86
  - !ruby/object:Gem::Version
61
87
  version: '0'
62
88
  required_rubygems_version: !ruby/object:Gem::Requirement
63
- none: false
64
89
  requirements:
65
- - - ! '>='
90
+ - - ">="
66
91
  - !ruby/object:Gem::Version
67
92
  version: '0'
68
93
  requirements: []
69
94
  rubyforge_project:
70
- rubygems_version: 1.8.23
95
+ rubygems_version: 2.2.0
71
96
  signing_key:
72
- specification_version: 3
97
+ specification_version: 4
73
98
  summary: Command-line wrapper for git and GitHub
74
99
  test_files: []