Hello community,

here is the log from the commit of package hub for openSUSE:Factory checked in 
at 2019-03-28 22:48:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hub (Old)
 and      /work/SRC/openSUSE:Factory/.hub.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hub"

Thu Mar 28 22:48:58 2019 rev:4 rq:689269 version:2.10.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/hub/hub.changes  2019-03-19 09:57:52.408115467 
+0100
+++ /work/SRC/openSUSE:Factory/.hub.new.25356/hub.changes       2019-03-28 
22:49:02.243050929 +0100
@@ -1,0 +2,8 @@
+Wed Mar 27 22:40:54 UTC 2019 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 2.10.1
+  Bugfix release:
+  * Allow repository names that start with a dash character
+  * Fix writing over existing cache files
+
+-------------------------------------------------------------------

Old:
----
  v2.10.0.tar.gz

New:
----
  v2.10.1.tar.gz

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

Other differences:
------------------
++++++ hub.spec ++++++
--- /var/tmp/diff_new_pack.8xU71I/_old  2019-03-28 22:49:02.959050799 +0100
+++ /var/tmp/diff_new_pack.8xU71I/_new  2019-03-28 22:49:02.963050799 +0100
@@ -18,7 +18,7 @@
 
 %define ver %{version}
 Name:           hub
-Version:        2.10.0
+Version:        2.10.1
 Release:        0
 Summary:        Command-line wrapper for git and GitHub
 License:        MIT

++++++ v2.10.0.tar.gz -> v2.10.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/README.md new/hub-2.10.1/README.md
--- old/hub-2.10.0/README.md    2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/README.md    2019-03-27 22:37:12.000000000 +0100
@@ -32,7 +32,7 @@
 
 #### Homebrew
 
-`hub` can be installed through [Homebrew](https://docs.brew.sh/Installation) 
on macOS:
+`hub` can be installed through 
[Homebrew/Linuxbrew](https://docs.brew.sh/Installation):
 
 ``` sh
 $ brew install hub
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/commands/commands.go 
new/hub-2.10.1/commands/commands.go
--- old/hub-2.10.0/commands/commands.go 2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/commands/commands.go 2019-03-27 22:37:12.000000000 +0100
@@ -9,9 +9,9 @@
 )
 
 var (
-       NameRe          = "[\\w.][\\w.-]*"
+       NameRe          = `[\w.-]+`
        OwnerRe         = "[a-zA-Z0-9][a-zA-Z0-9-]*"
-       NameWithOwnerRe = fmt.Sprintf("^(?:%s|%s\\/%s)$", NameRe, OwnerRe, 
NameRe)
+       NameWithOwnerRe = fmt.Sprintf(`^(%s/)?%s$`, OwnerRe, NameRe)
 
        CmdRunner = NewRunner()
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/commands/commands_test.go 
new/hub-2.10.1/commands/commands_test.go
--- old/hub-2.10.0/commands/commands_test.go    2019-02-24 10:46:57.000000000 
+0100
+++ new/hub-2.10.1/commands/commands_test.go    2019-03-27 22:37:12.000000000 
+0100
@@ -3,6 +3,7 @@
 import (
        "io/ioutil"
        "os"
+       "regexp"
        "testing"
 
        "github.com/bmizerany/assert"
@@ -123,3 +124,23 @@
        c.Call(args)
        assert.Equal(t, "baz", result)
 }
+
+func Test_NameWithOwnerRe(t *testing.T) {
+       re := regexp.MustCompile(NameWithOwnerRe)
+
+       assert.Equal(t, true, re.MatchString("o/n"))
+       assert.Equal(t, true, re.MatchString("own-er/my-project.git"))
+       assert.Equal(t, true, re.MatchString("my-project.git"))
+       assert.Equal(t, true, re.MatchString("my_project"))
+       assert.Equal(t, true, re.MatchString("-dash"))
+       assert.Equal(t, true, re.MatchString(".dotfiles"))
+
+       assert.Equal(t, false, re.MatchString(""))
+       assert.Equal(t, false, re.MatchString("/"))
+       assert.Equal(t, false, re.MatchString(" "))
+       assert.Equal(t, false, re.MatchString("owner/na me"))
+       assert.Equal(t, false, re.MatchString("owner/na/me"))
+       assert.Equal(t, false, re.MatchString("own.er/name"))
+       assert.Equal(t, false, re.MatchString("own_er/name"))
+       assert.Equal(t, false, re.MatchString("-owner/name"))
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/commands/help.go 
new/hub-2.10.1/commands/help.go
--- old/hub-2.10.0/commands/help.go     2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/commands/help.go     2019-03-27 22:37:12.000000000 +0100
@@ -195,6 +195,7 @@
 var helpText = `
 These GitHub commands are provided by hub:
 
+   api            Low-level GitHub API request interface
    browse         Open a GitHub page in the default browser
    ci-status      Show the status of GitHub checks for a commit
    compare        Open a compare page on GitHub
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/commands/remote.go 
new/hub-2.10.1/commands/remote.go
--- old/hub-2.10.0/commands/remote.go   2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/commands/remote.go   2019-03-27 22:37:12.000000000 +0100
@@ -56,10 +56,17 @@
 
 func transformRemoteArgs(args *Args) {
        ownerWithName := args.LastParam()
-       owner, name := parseRepoNameOwner(ownerWithName)
-       if owner == "" {
+
+       re := regexp.MustCompile(fmt.Sprintf(`^%s(/%s)?$`, OwnerRe, NameRe))
+       if !re.MatchString(ownerWithName) {
                return
        }
+       owner := ownerWithName
+       name := ""
+       if strings.Contains(ownerWithName, "/") {
+               parts := strings.SplitN(ownerWithName, "/", 2)
+               owner, name = parts[0], parts[1]
+       }
 
        localRepo, err := github.LocalRepo()
        utils.Check(err)
@@ -141,13 +148,3 @@
 
        return false
 }
-
-func parseRepoNameOwner(nameWithOwner string) (owner, name string) {
-       nameWithOwnerRe := fmt.Sprintf("^(%s)(?:\\/(%s))?$", OwnerRe, NameRe)
-       nameWithOwnerRegexp := regexp.MustCompile(nameWithOwnerRe)
-       if nameWithOwnerRegexp.MatchString(nameWithOwner) {
-               result := nameWithOwnerRegexp.FindStringSubmatch(nameWithOwner)
-               owner, name = result[1], result[2]
-       }
-       return
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/commands/remote_test.go 
new/hub-2.10.1/commands/remote_test.go
--- old/hub-2.10.0/commands/remote_test.go      2019-02-24 10:46:57.000000000 
+0100
+++ new/hub-2.10.1/commands/remote_test.go      2019-03-27 22:37:12.000000000 
+0100
@@ -10,16 +10,6 @@
        "github.com/github/hub/github"
 )
 
-func TestParseRepoNameOwner(t *testing.T) {
-       owner, repo := parseRepoNameOwner("jingweno")
-       assert.Equal(t, "jingweno", owner)
-       assert.Equal(t, "", repo)
-
-       owner, repo = parseRepoNameOwner("jingweno/gh")
-       assert.Equal(t, "jingweno", owner)
-       assert.Equal(t, "gh", repo)
-}
-
 func TestTransformRemoteArgs(t *testing.T) {
        repo := fixtures.SetupTestRepo()
        defer repo.TearDown()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/etc/README.md new/hub-2.10.1/etc/README.md
--- old/hub-2.10.0/etc/README.md        2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/etc/README.md        2019-03-27 22:37:12.000000000 +0100
@@ -1,8 +1,13 @@
 # Installation instructions
 
-## bash + Homebrew
+## Homebrew
 
-If you're using Homebrew, just run `brew install hub` and you should be all 
set with auto-completion.
+If you're using Homebrew, just run `brew install hub` and you should be all set
+with auto-completion. The extra steps to install hub completion scripts 
outlined
+below are *not needed*.
+
+For bash/zsh, a one-time setup might be needed to [enable completion for all
+Homebrew programs](https://docs.brew.sh/Shell-Completion).
 
 ## bash
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/features/help.feature 
new/hub-2.10.1/features/help.feature
--- old/hub-2.10.0/features/help.feature        2019-02-24 10:46:57.000000000 
+0100
+++ new/hub-2.10.1/features/help.feature        2019-03-27 22:37:12.000000000 
+0100
@@ -5,7 +5,7 @@
       """
       These GitHub commands are provided by hub:
 
-         browse         Open a GitHub page in the default browser
+         api            Low-level GitHub API request interface
       """
     And the output should contain "usage: git "
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/features/pull_request.feature 
new/hub-2.10.1/features/pull_request.feature
--- old/hub-2.10.0/features/pull_request.feature        2019-02-24 
10:46:57.000000000 +0100
+++ new/hub-2.10.1/features/pull_request.feature        2019-03-27 
22:37:12.000000000 +0100
@@ -1148,6 +1148,27 @@
     And the file ".git/PULLREQ_EDITMSG" should not exist
     And "git push --set-upstream origin HEAD:topic" should not be run
 
+  Scenario: Triangular workflow with --push
+    Given the "upstream" remote has url "git://github.com/github/coral.git"
+    And I am on the "master" branch pushed to "upstream/master"
+    # TODO: head should be "mislav:topic"
+    Given the GitHub API server:
+      """
+      post('/repos/github/coral/pulls') {
+        assert :base  => 'master',
+               :head  => 'github:topic',
+               :title => 'hereyougo'
+        status 201
+        json :html_url => "the://url"
+      }
+      """
+    When I successfully run `git checkout --quiet -b topic`
+    Given I make a commit with message "Fork commit"
+    When I successfully run `hub pull-request -p -m hereyougo`
+    Then the output should contain exactly "the://url\n"
+    # TODO: the push should be to the "origin" remote instead
+    And "git push --set-upstream upstream HEAD:topic" should be run
+
   Scenario: Automatically retry when --push resulted in 422
     Given The default aruba timeout is 7 seconds
     And the text editor adds:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/github/http.go 
new/hub-2.10.1/github/http.go
--- old/hub-2.10.0/github/http.go       2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/github/http.go       2019-03-27 22:37:12.000000000 +0100
@@ -29,6 +29,7 @@
 const textMediaType = "text/plain;charset=utf-8"
 const checksType = "application/vnd.github.antiope-preview+json;charset=utf-8"
 const draftsType = 
"application/vnd.github.shadow-cat-preview+json;charset=utf-8"
+const cacheVersion = 2
 
 var inspectHeaders = []string{
        "Authorization",
@@ -339,7 +340,7 @@
                                if err != nil {
                                        return
                                }
-                               cf, err := os.OpenFile(f, 
os.O_WRONLY|os.O_CREATE, 0600)
+                               cf, err := os.OpenFile(f, 
os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
                                if err != nil {
                                        return
                                }
@@ -378,6 +379,7 @@
                host = req.URL.Host
        }
        hash := md5.New()
+       fmt.Fprintf(hash, "%d:", cacheVersion)
        io.WriteString(hash, req.Header.Get("Accept"))
        io.WriteString(hash, req.Header.Get("Authorization"))
        queryParts := strings.Split(req.URL.RawQuery, "&")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/hub-2.10.0/version/version.go 
new/hub-2.10.1/version/version.go
--- old/hub-2.10.0/version/version.go   2019-02-24 10:46:57.000000000 +0100
+++ new/hub-2.10.1/version/version.go   2019-03-27 22:37:12.000000000 +0100
@@ -6,7 +6,7 @@
        "github.com/github/hub/git"
 )
 
-var Version = "2.10.0"
+var Version = "2.10.1"
 
 func FullVersion() (string, error) {
        gitVersion, err := git.Version()


Reply via email to