Hello community,

here is the log from the commit of package rubygem-hub for openSUSE:Factory 
checked in at 2015-02-11 16:46:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-hub (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-hub.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-hub"

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-hub/rubygem-hub.changes  2014-12-05 
21:05:12.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-hub.new/rubygem-hub.changes     
2015-02-11 16:46:43.000000000 +0100
@@ -1,0 +2,13 @@
+Tue Feb 10 17:55:01 UTC 2015 - [email protected]
+
+- Version bump 1.12.4:
+  * Don't try to read existing hub token from GitHub API since that API feature
+    is getting removed for security reasons. Instead, generate a new token each
+    time including the current machine identifier.
+  * Ruby 2.2.0 compatibility
+  * Enable retrying entering 2FA code if previous one was invalid
+  * Friendlier error messages when bad credentials were used
+  * Encode special characters in branch names for compare command
+  * Auto-private URLs in remote add when matching your own repos
+
+-------------------------------------------------------------------

Old:
----
  hub-1.12.3.gem

New:
----
  hub-1.12.4.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-hub.spec ++++++
--- /var/tmp/diff_new_pack.4GgLJO/_old  2015-02-11 16:46:44.000000000 +0100
+++ /var/tmp/diff_new_pack.4GgLJO/_new  2015-02-11 16:46:44.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-hub
 #
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 #
 
 Name:           rubygem-hub
-Version:        1.12.3
+Version:        1.12.4
 Release:        0
 %define mod_name hub
 %define mod_full_name %{mod_name}-%{version}
@@ -32,9 +32,9 @@
 Requires: rubygem(%{mod_name})
 # /MANUAL
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-BuildRequires:  ruby-macros >= 5
-BuildRequires:  %{ruby}
 BuildRequires:  %{rubygem gem2rpm}
+BuildRequires:  %{ruby}
+BuildRequires:  ruby-macros >= 5
 BuildRequires:  update-alternatives
 Url:            http://hub.github.com/
 Source:         http://rubygems.org/gems/%{mod_full_name}.gem
@@ -74,7 +74,6 @@
 install -Dm444 %{buildroot}$gemdir/gems/%{mod_full_name}/man/%{mod_name}.1 
%{buildroot}%{_mandir}/man1/%{mod_name}.1
 # /MANUAL
 
-
 %files
 %defattr(-,root,root,-)
 %dir %{_datadir}/bash-completion/completions

++++++ hub-1.12.3.gem -> hub-1.12.4.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2014-11-28 01:34:21.000000000 +0100
+++ new/README.md       2014-12-25 20:45:47.000000000 +0100
@@ -38,19 +38,17 @@
 
 ~~~ sh
 # Download or clone the project from GitHub:
-$ git clone git://github.com/github/hub.git
+$ git clone git://github.com/github/hub.git -b 1.12-stable
 $ cd hub
-$ rake install
+$ rake install PREFIX=/usr/local
 ~~~
 
-On a Unix-based OS, this installs under `PREFIX`, which is `/usr/local` by 
default.
-
 Now you should be ready to roll:
 
 ~~~ sh
 $ hub version
-git version 1.7.6
-hub version 1.8.3
+git version 2.1.4
+hub version 1.12.4
 ~~~
 
 #### Windows "Git Bash" (msysGit) note
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile        2014-11-28 01:34:21.000000000 +0100
+++ new/Rakefile        2014-12-25 20:45:47.000000000 +0100
@@ -151,7 +151,13 @@
 end
 
 task :gem_release do
-  sh "gem release -t"
+  require File.expand_path('../lib/hub/version', __FILE__)
+  # sh "git add lib/hub/version.rb"
+  # sh "git commit -m 'hub #{Hub::VERSION}'"
+  # sh "git tag v#{Hub::VERSION}"
+  sh "RUBYOPT= git push origin HEAD v#{Hub::VERSION}"
+  sh "gem build hub.gemspec"
+  sh "gem push hub-#{Hub::VERSION}.gem"
 end
 
 desc "Publish to Homebrew"
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/hub/commands.rb new/lib/hub/commands.rb
--- old/lib/hub/commands.rb     2014-11-28 01:34:21.000000000 +0100
+++ new/lib/hub/commands.rb     2014-12-25 20:45:47.000000000 +0100
@@ -359,6 +359,11 @@
         args.pop
       end
 
+      if user.downcase == github_user.downcase
+        user = github_user
+        ssh = true
+      end
+
       args << git_url(user, repo, :private => ssh)
     end
 
@@ -704,9 +709,9 @@
 
         path = case subpage
         when 'commits'
-          "/commits/#{branch_in_url(branch)}"
+          "/commits/#{branch_in_url(branch.short_name)}"
         when 'tree', NilClass
-          "/tree/#{branch_in_url(branch)}" if branch and !branch.master?
+          "/tree/#{branch_in_url(branch.short_name)}" if branch and 
!branch.master?
         else
           "/#{subpage}"
         end
@@ -742,7 +747,8 @@
           end
         end
 
-        path = '/compare/%s' % range
+        escaped_range = range.include?('..') ? range : branch_in_url(range)
+        path = '/compare/%s' % escaped_range
         project.web_url(path, api_client.config.method(:protocol))
       end
     end
@@ -842,8 +848,10 @@
     # from the command line.
     #
 
-    def branch_in_url(branch)
-      CGI.escape(branch.short_name).gsub("%2F", "/")
+    def branch_in_url(branch_name)
+      branch_name.to_str.gsub(/[^\w!.*'():^~\/-]/) do |char|
+        '%' + char.unpack('H2' * char.bytesize).join('%').upcase
+      end
     end
 
     def api_client
@@ -1157,8 +1165,7 @@
 
     def display_api_exception(action, response)
       $stderr.puts "Error #{action}: #{response.message.strip} (HTTP 
#{response.status})"
-      if 422 == response.status and response.error_message?
-        # display validation errors
+      if [401, 403, 422].include?(response.status) && response.error_message?
         msg = response.error_message
         msg = msg.join("\n") if msg.respond_to? :join
         warn msg
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/hub/github_api.rb new/lib/hub/github_api.rb
--- old/lib/hub/github_api.rb   2014-11-28 01:34:21.000000000 +0100
+++ new/lib/hub/github_api.rb   2014-12-25 20:45:47.000000000 +0100
@@ -333,36 +333,49 @@
         end
       end
 
-      def obtain_oauth_token host, user, two_factor_code = nil
+      def obtain_oauth_token host, user
         auth_url = URI.parse("https://%s@%s/authorizations"; % 
[CGI.escape(user), host])
+        auth_params = {
+          :scopes => ['repo'],
+          :note => "hub for #{local_user}@#{local_hostname}",
+          :note_url => oauth_app_url
+        }
+        res = nil
+        two_factor_code = nil
 
-        # dummy request to trigger a 2FA SMS since a HTTP GET won't do it
-        post(auth_url) if !two_factor_code
+        loop do
+          res = post(auth_url, auth_params) do |req|
+            req['X-GitHub-OTP'] = two_factor_code if two_factor_code
+          end
 
-        # first try to fetch existing authorization
-        res = get_all(auth_url) do |req|
-          req['X-GitHub-OTP'] = two_factor_code if two_factor_code
-        end
-        unless res.success?
-          if !two_factor_code && res['X-GitHub-OTP'].to_s.include?('required')
+          if res.success?
+            break
+          elsif res.status == 401 && 
res['X-GitHub-OTP'].to_s.include?('required')
+            $stderr.puts "warning: invalid two-factor code" if two_factor_code
             two_factor_code = config.prompt_auth_code
-            return obtain_oauth_token(host, user, two_factor_code)
+          elsif res.status == 422 && 'already_exists' == 
res.data['errors'][0]['code']
+            if auth_params[:note] =~ / (\d+)$/
+              res.error! if $1.to_i >= 9
+              auth_params[:note].succ!
+            else
+              auth_params[:note] += ' 2'
+            end
           else
             res.error!
           end
         end
 
-        if found = res.data.find {|auth| auth['note'] == 'hub' || 
auth['note_url'] == oauth_app_url }
-          found['token']
-        else
-          # create a new authorization
-          res = post auth_url,
-            :scopes => %w[repo], :note => 'hub', :note_url => oauth_app_url do 
|req|
-              req['X-GitHub-OTP'] = two_factor_code if two_factor_code
-            end
-          res.error! unless res.success?
-          res.data['token']
-        end
+        res.data['token']
+      end
+
+      def local_user
+        require 'etc'
+        Etc.getlogin
+      end
+
+      def local_hostname
+        require 'socket'
+        Socket.gethostname
       end
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/hub/speedy_stdlib.rb new/lib/hub/speedy_stdlib.rb
--- old/lib/hub/speedy_stdlib.rb        2014-11-28 01:34:21.000000000 +0100
+++ new/lib/hub/speedy_stdlib.rb        2014-12-25 20:45:47.000000000 +0100
@@ -38,7 +38,19 @@
     InvalidComponentError = Class.new(Error)
 
     def self.parse(str)
-      URI::HTTP.new(str)
+      m = str.to_s.match(%r{^ ([\w-]+): // (?:([^/@]+)@)? ([^/?#]+) }x)
+      raise InvalidURIError unless m
+
+      _, scheme, userinfo, host = m.to_a
+      default_port = scheme == 'https' ? 443 : 80
+      host, port = host.split(':', 2)
+      port = port ? port.to_i : default_port
+
+      path, fragment = m.post_match.split('#', 2)
+      path, query = path.split('?', 2) if path
+      path = path.to_s
+
+      URI::HTTP.new(scheme, userinfo, host, port, nil, path, nil, query, 
fragment)
     end
 
     def self.encode_www_form(params)
@@ -61,15 +73,14 @@
       attr_reader :port
       alias hostname host
 
-      def initialize(str)
-        m = str.to_s.match(%r{^ ([\w-]+): // (?:([^/@]+)@)? ([^/?#]+) }x)
-        raise InvalidURIError unless m
-        _, self.scheme, self.userinfo, host = m.to_a
-        self.host, port = host.split(':', 2)
-        self.port = port ? port.to_i : default_port
-        path, self.fragment = m.post_match.split('#', 2)
-        path, self.query = path.split('?', 2) if path
-        self.path = path.to_s
+      def initialize(scheme, userinfo, host, port, registry, path, opaque, 
query, fragment, *extra)
+        self.scheme = scheme
+        self.userinfo = userinfo
+        self.host = host
+        self.port = port
+        self.path = path
+        self.query = query
+        self.fragment = fragment
       end
 
       def to_s
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/hub/version.rb new/lib/hub/version.rb
--- old/lib/hub/version.rb      2014-11-28 01:34:21.000000000 +0100
+++ new/lib/hub/version.rb      2014-12-25 20:45:47.000000000 +0100
@@ -1,3 +1,3 @@
 module Hub
-  Version = VERSION = '1.12.3'
+  Version = VERSION = '1.12.4'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/man/hub.1 new/man/hub.1
--- old/man/hub.1       2014-11-28 01:34:21.000000000 +0100
+++ new/man/hub.1       2014-12-25 20:45:47.000000000 +0100
@@ -1,7 +1,7 @@
 .\" generated with Ronn/v0.7.3
 .\" http://github.com/rtomayko/ronn/tree/0.7.3
 .
-.TH "HUB" "1" "February 2014" "GITHUB" "Hub Manual"
+.TH "HUB" "1" "December 2014" "GITHUB" "Hub Manual"
 .
 .SH "NAME"
 \fBhub\fR \- git + hub = github
@@ -52,7 +52,7 @@
 \fBgit create\fR [\fINAME\fR] [\fB\-p\fR] [\fB\-d\fR \fIDESCRIPTION\fR] 
[\fB\-h\fR \fIHOMEPAGE\fR]
 .
 .br
-\fBgit browse\fR [\fB\-u\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR] [SUBPAGE]
+\fBgit browse\fR [\fB\-u\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR|\-\- 
[SUBPAGE]]
 .
 .br
 \fBgit compare\fR [\fB\-u\fR] [\fIUSER\fR] [[\fISTART\fR\.\.\.]\fIEND\fR]
@@ -136,7 +136,7 @@
 Create a new public GitHub repository from the current git repository and add 
remote \fBorigin\fR at "git@github\.com:\fIUSER\fR/\fIREPOSITORY\fR\.git"; 
\fIUSER\fR is your GitHub username and \fIREPOSITORY\fR is the current working 
directory name\. To explicitly name the new repository, pass in \fINAME\fR, 
optionally in \fIORGANIZATION\fR/\fINAME\fR form to create under an 
organization you\'re a member of\. With \fB\-p\fR, create a private repository, 
and with \fB\-d\fR and \fB\-h\fR set the repository\'s description and homepage 
URL, respectively\.
 .
 .TP
-\fBgit browse\fR [\fB\-u\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR] [SUBPAGE]
+\fBgit browse\fR [\fB\-u\fR] [[\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR|\-\- 
[SUBPAGE]]
 Open repository\'s GitHub page in the system\'s default web browser using 
\fBopen(1)\fR or the \fBBROWSER\fR env variable\. If the repository isn\'t 
specified, \fBbrowse\fR opens the page of the repository found in the current 
directory\. If SUBPAGE is specified, the browser will open on the specified 
subpage: one of "wiki", "commits", "issues" or other (the default is "tree")\. 
With \fB\-u\fR, outputs the URL rather than opening the browser\.
 .
 .TP
@@ -327,7 +327,7 @@
 .nf
 
 $ git checkout https://github\.com/defunkt/hub/pull/73
-> git remote add \-f \-t feature git://github:com/mislav/hub\.git
+> git remote add \-f \-t feature mislav git://github\.com/mislav/hub\.git
 > git checkout \-\-track \-B mislav\-feature mislav/feature
 
 $ git checkout https://github\.com/defunkt/hub/pull/73 custom\-branch\-name
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/man/hub.1.html new/man/hub.1.html
--- old/man/hub.1.html  2014-11-28 01:34:21.000000000 +0100
+++ new/man/hub.1.html  2014-12-25 20:45:47.000000000 +0100
@@ -97,7 +97,7 @@
 <h3 id="Custom-git-commands-">Custom git commands:</h3>
 
 <p><code>git create</code> [<var>NAME</var>] [<code>-p</code>] 
[<code>-d</code> <var>DESCRIPTION</var>] [<code>-h</code> 
<var>HOMEPAGE</var>]<br />
-<code>git browse</code> [<code>-u</code>] 
[[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] [SUBPAGE]<br />
+<code>git browse</code> [<code>-u</code>] 
[[<var>USER</var><code>/</code>]<var>REPOSITORY</var>|-- [SUBPAGE]]<br />
 <code>git compare</code> [<code>-u</code>] [<var>USER</var>] 
[[<var>START</var>...]<var>END</var>]<br />
 <code>git fork</code> [<code>--no-remote</code>]<br />
 <code>git pull-request</code> [<code>-o</code>|<code>--browse</code>] 
[<code>-f</code>] [<code>-m</code> <var>MESSAGE</var>|<code>-F</code> 
<var>FILE</var>|<code>-i</code> <var>ISSUE</var>|<var>ISSUE-URL</var>] 
[<code>-b</code> <var>BASE</var>] [<code>-h</code> <var>HEAD</var>]<br />
@@ -169,7 +169,7 @@
 <var>ORGANIZATION</var>/<var>NAME</var> form to create under an organization 
you're a
 member of. With <code>-p</code>, create a private repository, and with 
<code>-d</code> and <code>-h</code>
 set the repository's description and homepage URL, respectively.</p></dd>
-<dt><code>git browse</code> [<code>-u</code>] 
[[<var>USER</var><code>/</code>]<var>REPOSITORY</var>] 
[SUBPAGE]</dt><dd><p>Open repository's GitHub page in the system's default web 
browser using
+<dt><code>git browse</code> [<code>-u</code>] 
[[<var>USER</var><code>/</code>]<var>REPOSITORY</var>|-- 
[SUBPAGE]]</dt><dd><p>Open repository's GitHub page in the system's default web 
browser using
 <code>open(1)</code> or the <code>BROWSER</code> env variable. If the 
repository isn't
 specified, <code>browse</code> opens the page of the repository found in the 
current
 directory. If SUBPAGE is specified, the browser will open on the specified
@@ -330,7 +330,7 @@
 <h3 id="git-checkout">git checkout</h3>
 
 <pre><code>$ git checkout https://github.com/defunkt/hub/pull/73
-&gt; git remote add -f -t feature git://github:com/mislav/hub.git
+&gt; git remote add -f -t feature mislav git://github.com/mislav/hub.git
 &gt; git checkout --track -B mislav-feature mislav/feature
 
 $ git checkout https://github.com/defunkt/hub/pull/73 custom-branch-name
@@ -459,7 +459,7 @@
 
   <ol class='man-decor man-foot man foot'>
     <li class='tl'>GITHUB</li>
-    <li class='tc'>February 2014</li>
+    <li class='tc'>December 2014</li>
     <li class='tr'>hub(1)</li>
   </ol>
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/man/hub.1.ronn new/man/hub.1.ronn
--- old/man/hub.1.ronn  2014-11-28 01:34:21.000000000 +0100
+++ new/man/hub.1.ronn  2014-12-25 20:45:47.000000000 +0100
@@ -24,7 +24,7 @@
 ### Custom git commands:
 
 `git create` [<NAME>] [`-p`] [`-d` <DESCRIPTION>] [`-h` <HOMEPAGE>]  
-`git browse` [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]  
+`git browse` [`-u`] [[<USER>`/`]<REPOSITORY>|-- [SUBPAGE]]  
 `git compare` [`-u`] [<USER>] [[<START>...]<END>]  
 `git fork` [`--no-remote`]  
 `git pull-request` [`-o`|`--browse`] [`-f`] [`-m` <MESSAGE>|`-F` <FILE>|`-i` 
<ISSUE>|<ISSUE-URL>] [`-b` <BASE>] [`-h` <HEAD>]  
@@ -121,7 +121,7 @@
     member of. With `-p`, create a private repository, and with `-d` and `-h`
     set the repository's description and homepage URL, respectively.
 
-  * `git browse` [`-u`] [[<USER>`/`]<REPOSITORY>] [SUBPAGE]:
+  * `git browse` [`-u`] [[<USER>`/`]<REPOSITORY>|-- [SUBPAGE]]:
     Open repository's GitHub page in the system's default web browser using
     `open(1)` or the `BROWSER` env variable. If the repository isn't
     specified, `browse` opens the page of the repository found in the current
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2014-11-28 01:34:21.000000000 +0100
+++ new/metadata        2014-12-25 20:45:47.000000000 +0100
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: hub
 version: !ruby/object:Gem::Version
-  version: 1.12.3
+  version: 1.12.4
 platform: ruby
 authors:
 - Chris Wanstrath
@@ -9,7 +9,7 @@
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2014-11-28 00:00:00.000000000 Z
+date: 2014-12-25 00:00:00.000000000 Z
 dependencies: []
 description: |2
     `hub` is a command line utility which adds GitHub knowledge to `git`.

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to