Hello community, here is the log from the commit of package hub for openSUSE:Factory checked in at 2019-04-11 12:16:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hub (Old) and /work/SRC/openSUSE:Factory/.hub.new.27019 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hub" Thu Apr 11 12:16:32 2019 rev:5 rq:692925 version:2.11.1 Changes: -------- --- /work/SRC/openSUSE:Factory/hub/hub.changes 2019-03-28 22:49:02.243050929 +0100 +++ /work/SRC/openSUSE:Factory/.hub.new.27019/hub.changes 2019-04-11 12:16:39.128915798 +0200 @@ -1,0 +2,11 @@ +Sat Mar 30 10:10:13 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 2.11.1 + * Fix non-draft pull requests for certain repositories +- Update to version 2.11.0 + * Create draft pull requests with hub pull-request --draft + Draft pull requests are considered work in progress: they don't + automatically request others for review and they are not + mergeable while in their draft state. + +------------------------------------------------------------------- Old: ---- v2.10.1.tar.gz New: ---- v2.11.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hub.spec ++++++ --- /var/tmp/diff_new_pack.PKq2pE/_old 2019-04-11 12:16:41.120916803 +0200 +++ /var/tmp/diff_new_pack.PKq2pE/_new 2019-04-11 12:16:41.124916805 +0200 @@ -18,7 +18,7 @@ %define ver %{version} Name: hub -Version: 2.10.1 +Version: 2.11.1 Release: 0 Summary: Command-line wrapper for git and GitHub License: MIT ++++++ v2.10.1.tar.gz -> v2.11.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/.agignore new/hub-2.11.1/.agignore --- old/hub-2.10.1/.agignore 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/.agignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -./tags -site/* -tmp/* -vendor/* -bundle/* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/commands/issue.go new/hub-2.11.1/commands/issue.go --- old/hub-2.10.1/commands/issue.go 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/commands/issue.go 2019-03-29 12:33:51.000000000 +0100 @@ -313,16 +313,13 @@ var labelStrings []string var rawLabels []string for _, label := range issue.Labels { - if !colorize { - labelStrings = append(labelStrings, fmt.Sprintf(" %s ", label.Name)) - continue - } - color, err := utils.NewColor(label.Color) - if err != nil { + if colorize { + color, err := utils.NewColor(label.Color) utils.Check(err) + labelStrings = append(labelStrings, colorizeLabel(label, color)) + } else { + labelStrings = append(labelStrings, fmt.Sprintf(" %s ", label.Name)) } - - labelStrings = append(labelStrings, colorizeLabel(label, color)) rawLabels = append(rawLabels, label.Name) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/commands/pull_request.go new/hub-2.11.1/commands/pull_request.go --- old/hub-2.10.1/commands/pull_request.go 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/commands/pull_request.go 2019-03-29 12:33:51.000000000 +0100 @@ -16,7 +16,7 @@ var cmdPullRequest = &Command{ Run: pullRequest, Usage: ` -pull-request [-focp] [-b <BASE>] [-h <HEAD>] [-r <REVIEWERS> ] [-a <ASSIGNEES>] [-M <MILESTONE>] [-l <LABELS>] +pull-request [-focpd] [-b <BASE>] [-h <HEAD>] [-r <REVIEWERS> ] [-a <ASSIGNEES>] [-M <MILESTONE>] [-l <LABELS>] pull-request -m <MESSAGE> [--edit] pull-request -F <FILE> [--edit] pull-request -i <ISSUE> @@ -86,6 +86,9 @@ -l, --labels <LABELS> Add a comma-separated list of labels to this pull request. Labels will be created if they do not already exist. + + -d, --draft + Create the pull request as a draft. ## Examples: $ hub pull-request @@ -319,6 +322,10 @@ "head": fullHead, } + if args.Flag.Bool("--draft") { + params["draft"] = true + } + if title != "" { params["title"] = title if body != "" { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/commands/runner.go new/hub-2.11.1/commands/runner.go --- old/hub-2.10.1/commands/runner.go 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/commands/runner.go 2019-03-29 12:33:51.000000000 +0100 @@ -65,7 +65,10 @@ return err } - gitArgs := []string{args.Command} + gitArgs := []string{} + if args.Command != "" { + gitArgs = append(gitArgs, args.Command) + } gitArgs = append(gitArgs, args.Params...) return git.Run(gitArgs...) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/features/git_compatibility.feature new/hub-2.11.1/features/git_compatibility.feature --- old/hub-2.10.1/features/git_compatibility.feature 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/features/git_compatibility.feature 2019-03-29 12:33:51.000000000 +0100 @@ -31,3 +31,8 @@ Scenario: Doesn't sabotage --exec-path When I successfully run `hub --exec-path` Then the output should not contain "These GitHub commands" + + Scenario: Shows help with --git-dir + When I run `hub --git-dir=.git` + Then the exit status should be 1 + And the output should contain "usage: git " diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/features/issue.feature new/hub-2.11.1/features/issue.feature --- old/hub-2.10.1/features/issue.feature 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/features/issue.feature 2019-03-29 12:33:51.000000000 +0100 @@ -247,6 +247,38 @@ 13,mislav\n """ + Scenario: Custom format with no-color labels + Given the GitHub API server: + """ + get('/repos/github/hub/issues') { + json [ + { :number => 102, + :title => "First issue", + :state => "open", + :user => { :login => "morganwahl" }, + :labels => [ + { :name => 'Has Migration', + :color => 'cfcfcf' }, + { :name => 'Maintenance Window', + :color => '888888' }, + ] + }, + { :number => 201, + :title => "No labels", + :state => "open", + :user => { :login => "octocat" }, + :labels => [] + }, + ] + } + """ + When I successfully run `hub issue -f "%I: %L%n" --color=never` + Then the output should contain exactly: + """ + 102: Has Migration, Maintenance Window + 201: \n + """ + Scenario: List all assignees Given the GitHub API server: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/features/pull_request.feature new/hub-2.11.1/features/pull_request.feature --- old/hub-2.10.1/features/pull_request.feature 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/features/pull_request.feature 2019-03-29 12:33:51.000000000 +0100 @@ -4,6 +4,25 @@ And I am "mislav" on github.com with OAuth token "OTOKEN" And the git commit editor is "vim" + Scenario: Basic pull request + Given the GitHub API server: + """ + post('/repos/mislav/coral/pulls') { + halt 400 unless request.env['HTTP_ACCEPT'] == 'application/vnd.github.shadow-cat-preview+json;charset=utf-8' + halt 400 if (params.keys - %w[title body base head draft issue]).any? + assert :title => 'hello', + :body => nil, + :base => 'master', + :head => 'mislav:master', + :draft => nil, + :issue => nil + status 201 + json :html_url => "the://url" + } + """ + When I successfully run `hub pull-request -m hello` + Then the output should contain exactly "the://url\n" + Scenario: Detached HEAD Given I am in detached HEAD When I run `hub pull-request` @@ -1232,3 +1251,16 @@ """ And the output should match /Given up after retrying for 5\.\d seconds\./ And a file named ".git/PULLREQ_EDITMSG" should exist + + Scenario: Draft pull request + Given the GitHub API server: + """ + post('/repos/mislav/coral/pulls') { + halt 400 unless request.env['HTTP_ACCEPT'] == 'application/vnd.github.shadow-cat-preview+json;charset=utf-8' + assert :draft => true + status 201 + json :html_url => "the://url" + } + """ + When I successfully run `hub pull-request -d -m wip` + Then the output should contain exactly "the://url\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/github/client.go new/hub-2.11.1/github/client.go --- old/hub-2.10.1/github/client.go 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/github/client.go 2019-03-29 12:33:51.000000000 +0100 @@ -119,7 +119,7 @@ return } - res, err := api.PostJSON(fmt.Sprintf("repos/%s/%s/pulls", project.Owner, project.Name), params) + res, err := api.PostJSONPreview(fmt.Sprintf("repos/%s/%s/pulls", project.Owner, project.Name), params, draftsType) if err = checkStatus(201, "creating pull request", res, err); err != nil { if res != nil && res.StatusCode == 404 { projectUrl := strings.SplitN(project.WebURL("", "", ""), "://", 2)[1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/github/http.go new/hub-2.11.1/github/http.go --- old/hub-2.10.1/github/http.go 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/github/http.go 2019-03-29 12:33:51.000000000 +0100 @@ -433,6 +433,12 @@ return c.jsonRequest("POST", path, payload, nil) } +func (c *simpleClient) PostJSONPreview(path string, payload interface{}, mimeType string) (*simpleResponse, error) { + return c.jsonRequest("POST", path, payload, func(req *http.Request) { + req.Header.Set("Accept", mimeType) + }) +} + func (c *simpleClient) PatchJSON(path string, payload interface{}) (*simpleResponse, error) { return c.jsonRequest("PATCH", path, payload, nil) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.10.1/version/version.go new/hub-2.11.1/version/version.go --- old/hub-2.10.1/version/version.go 2019-03-27 22:37:12.000000000 +0100 +++ new/hub-2.11.1/version/version.go 2019-03-29 12:33:51.000000000 +0100 @@ -6,7 +6,7 @@ "github.com/github/hub/git" ) -var Version = "2.10.1" +var Version = "2.11.1" func FullVersion() (string, error) { gitVersion, err := git.Version()
