Hello community, here is the log from the commit of package hub for openSUSE:Factory checked in at 2019-10-08 19:57:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hub (Old) and /work/SRC/openSUSE:Factory/.hub.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hub" Tue Oct 8 19:57:38 2019 rev:9 rq:735826 version:2.12.8 Changes: -------- --- /work/SRC/openSUSE:Factory/hub/hub.changes 2019-09-23 12:39:55.385585228 +0200 +++ /work/SRC/openSUSE:Factory/.hub.new.2352/hub.changes 2019-10-08 19:57:39.816245413 +0200 @@ -1,0 +2,9 @@ +Sat Oct 5 20:52:32 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 2.12.8 + * hub compare: improve upstream branch detection & error messages + * hub compare: allow slash character in branch names + * hub api: fix GraphQL requests made to Enterprise hosts + * Docs: clarify --message, --file, and --edit flags + +------------------------------------------------------------------- Old: ---- hub-2.12.6.tar.gz New: ---- hub-2.12.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hub.spec ++++++ --- /var/tmp/diff_new_pack.HbXscn/_old 2019-10-08 19:57:40.400243664 +0200 +++ /var/tmp/diff_new_pack.HbXscn/_new 2019-10-08 19:57:40.400243664 +0200 @@ -18,7 +18,7 @@ %define ver %{version} Name: hub -Version: 2.12.6 +Version: 2.12.8 Release: 0 Summary: Command-line wrapper for git and GitHub License: MIT ++++++ hub-2.12.6.tar.gz -> hub-2.12.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/.travis.yml new/hub-2.12.8/.travis.yml --- old/hub-2.12.6/.travis.yml 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/.travis.yml 2019-10-03 02:46:27.000000000 +0200 @@ -5,6 +5,7 @@ - export PATH=~/bin:"$PATH" language: go go: + - 1.13.x - 1.12.x - 1.11.x - 1.10.x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/Makefile new/hub-2.12.8/Makefile --- old/hub-2.12.6/Makefile 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/Makefile 2019-10-03 02:46:27.000000000 +0200 @@ -3,12 +3,12 @@ BUILD_DATE = $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" '+%d %b %Y' 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" '+%d %b %Y') HUB_VERSION = $(shell bin/hub version | tail -1) FLAGS_ALL = $(shell go version | grep -q 'go1.[89]' || echo 'all=') -export MOD_VENDOR_ARG := $(shell go version | grep -q 'go1.1[^01]' && echo '-mod=vendor') +export GOFLAGS := $(shell go version | grep -q 'go1.1[^0]' && echo '-mod=vendor') export LDFLAGS := -extldflags '$(LDFLAGS)' export GCFLAGS := $(FLAGS_ALL)-trimpath '$(PWD)' export ASMFLAGS := $(FLAGS_ALL)-trimpath '$(PWD)' -ifneq ($(MOD_VENDOR_ARG),) +ifneq ($(GOFLAGS),) export GO111MODULE=on unexport GOPATH endif @@ -52,7 +52,7 @@ script/build -o $@ bin/md2roff: $(SOURCES) - go build $(MOD_VENDOR_ARG) -o $@ github.com/github/hub/md2roff-bin + go build -o $@ github.com/github/hub/md2roff-bin test: go test ./... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/commands/compare.go new/hub-2.12.8/commands/compare.go --- old/hub-2.12.6/commands/compare.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/commands/compare.go 2019-10-03 02:46:27.000000000 +0200 @@ -13,8 +13,8 @@ var cmdCompare = &Command{ Run: compare, Usage: ` -compare [-uc] [<USER>] [[<START>...]<END>] compare [-uc] [-b <BASE>] +compare [-uc] [<OWNER>] [<BASE>...]<HEAD> `, Long: `Open a GitHub compare page in a web browser. @@ -28,22 +28,31 @@ -b, --base <BASE> Base branch to compare against in case no explicit arguments were given. - [<START>...]<END> + [<BASE>...]<HEAD> Branch names, tag names, or commit SHAs specifying the range to compare. - <END> defaults to the current branch name. - If a range with two dots ('A..B') is given, it will be transformed into a range with three dots. + The <BASE> portion defaults to the default branch of the repository. + + The <HEAD> argument defaults to the current branch. If the current branch + is not pushed to a remote, the command will error. + + <OWNER> + Optionally specify the owner of the repository for the compare page URL. + ## Examples: + $ hub compare + > open https://github.com/OWNER/REPO/compare/BRANCH + $ hub compare refactor - > open https://github.com/USER/REPO/compare/refactor + > open https://github.com/OWNER/REPO/compare/refactor $ hub compare v1.0..v1.1 - > open https://github.com/USER/REPO/compare/v1.0...v1.1 + > open https://github.com/OWNER/REPO/compare/v1.0...v1.1 $ hub compare -u jingweno feature - > echo https://github.com/jingweno/REPO/compare/feature + https://github.com/jingweno/REPO/compare/feature ## See also: @@ -59,58 +68,60 @@ localRepo, err := github.LocalRepo() utils.Check(err) - var ( - branch *github.Branch - project *github.Project - r string - ) + mainProject, err := localRepo.MainProject() + utils.Check(err) + host, err := github.CurrentConfig().PromptForHost(mainProject.Host) + utils.Check(err) + + var r string flagCompareBase := args.Flag.Value("--base") if args.IsParamsEmpty() { - branch, project, err = localRepo.RemoteBranchAndProject("", false) - utils.Check(err) + currentBranch, err := localRepo.CurrentBranch() + if err != nil { + utils.Check(command.UsageError(err.Error())) + } - if branch == nil || - (branch.IsMaster() && flagCompareBase == "") || - (flagCompareBase == branch.ShortName()) { - utils.Check(command.UsageError("")) - } else { - r = branch.ShortName() - if flagCompareBase != "" { - r = parseCompareRange(flagCompareBase + "..." + r) + var remoteBranch *github.Branch + var remoteProject *github.Project + + remoteBranch, remoteProject, err = findPushTarget(currentBranch) + if err != nil { + if remoteProject, err = deducePushTarget(currentBranch, host.User); err == nil { + remoteBranch = currentBranch + } else { + utils.Check(fmt.Errorf("the current branch '%s' doesn't seem pushed to a remote", currentBranch.ShortName())) + } + } + + r = remoteBranch.ShortName() + if remoteProject.SameAs(mainProject) { + if flagCompareBase == "" && remoteBranch.IsMaster() { + utils.Check(fmt.Errorf("the branch to compare '%s' is the default branch", remoteBranch.ShortName())) } + } else { + r = fmt.Sprintf("%s:%s", remoteProject.Owner, r) + } + + if flagCompareBase == r { + utils.Check(fmt.Errorf("the branch to compare '%s' is the same as --base", r)) + } else if flagCompareBase != "" { + r = fmt.Sprintf("%s...%s", flagCompareBase, r) } } else { if flagCompareBase != "" { utils.Check(command.UsageError("")) } else { r = parseCompareRange(args.RemoveParam(args.ParamsSize() - 1)) - project, err = localRepo.CurrentProject() - if args.IsParamsEmpty() { - utils.Check(err) - } else { - projectName := "" - projectHost := "" - if err == nil { - projectName = project.Name - projectHost = project.Host - } - project = github.NewProject(args.RemoveParam(args.ParamsSize()-1), projectName, projectHost) - if project.Name == "" { - utils.Check(fmt.Errorf("error: missing project name (owner: %q)\n", project.Owner)) - } + if !args.IsParamsEmpty() { + owner := args.RemoveParam(args.ParamsSize() - 1) + mainProject = github.NewProject(owner, mainProject.Name, mainProject.Host) } } } - if project == nil { - project, err = localRepo.CurrentProject() - utils.Check(err) - } - - subpage := utils.ConcatPaths("compare", rangeQueryEscape(r)) - url := project.WebURL("", "", subpage) + url := mainProject.WebURL("", "", "compare/"+rangeQueryEscape(r)) args.NoForward() flagCompareURLOnly := args.Flag.Bool("--url") @@ -119,7 +130,7 @@ } func parseCompareRange(r string) string { - shaOrTag := fmt.Sprintf("((?:%s:)?\\w(?:[\\w.-]*\\w)?)", OwnerRe) + shaOrTag := fmt.Sprintf("((?:%s:)?\\w(?:[\\w/.-]*\\w)?)", OwnerRe) shaOrTagRange := fmt.Sprintf("^%s\\.\\.%s$", shaOrTag, shaOrTag) shaOrTagRangeRegexp := regexp.MustCompile(shaOrTagRange) return shaOrTagRangeRegexp.ReplaceAllString(r, "$1...$2") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/commands/issue.go new/hub-2.12.8/commands/issue.go --- old/hub-2.12.6/commands/issue.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/commands/issue.go 2019-10-03 02:46:27.000000000 +0200 @@ -117,14 +117,19 @@ The text up to the first blank line in <MESSAGE> is treated as the issue title, and the rest is used as issue description in Markdown format. - If multiple <MESSAGE> options are given, their values are concatenated as - separate paragraphs. + When multiple '--message' are passed, their values are concatenated with a + blank line in-between. + + When neither '--message' nor '--file' were supplied to 'issue create', a + text editor will open to author the title and description in. -F, --file <FILE> - Read the issue title and description from <FILE>. + Read the issue title and description from <FILE>. Pass "-" to read from + standard input instead. See '--message' for the formatting rules. -e, --edit - Further edit the contents of <FILE> in a text editor before submitting. + Open the issue title and description in a text editor before submitting. + This can be used in combination with '--message' or '--file'. -o, --browse Open the new issue in a web browser. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/commands/pull_request.go new/hub-2.12.8/commands/pull_request.go --- old/hub-2.12.6/commands/pull_request.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/commands/pull_request.go 2019-10-03 02:46:27.000000000 +0200 @@ -32,18 +32,23 @@ request title, and the rest is used as pull request description in Markdown format. - If multiple <MESSAGE> options are given, their values are concatenated as - separate paragraphs. + When multiple '--message' are passed, their values are concatenated with a + blank line in-between. + + When neither '--message' nor '--file' were supplied, a text editor will open + to author the title and description in. --no-edit Use the message from the first commit on the branch as pull request title and description without opening a text editor. -F, --file <FILE> - Read the pull request title and description from <FILE>. + Read the pull request title and description from <FILE>. Pass "-" to read + from standard input instead. See '--message' for the formatting rules. -e, --edit - Further edit the contents of <FILE> in a text editor before submitting. + Open the pull request title and description in a text editor before + submitting. This can be used in combination with '--message' or '--file'. -i, --issue <ISSUE> Convert <ISSUE> (referenced by its number) to a pull request. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/commands/release.go new/hub-2.12.8/commands/release.go --- old/hub-2.12.6/commands/release.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/commands/release.go 2019-10-03 02:46:27.000000000 +0200 @@ -46,9 +46,9 @@ Edit the GitHub release for the specified <TAG> name. Accepts the same options as _create_ command. Publish a draft with '--draft=false'. - When <MESSAGE> or <FILE> are not specified, a text editor will open - pre-populated with current release title and body. To re-use existing title - and body unchanged, pass '-m ""'. + Without '--message' or '--file', a text editor will open pre-populated with + the current release title and body. To re-use existing title and body + unchanged, pass '-m ""'. * _download_: Download the assets attached to release for the specified <TAG>. @@ -77,14 +77,19 @@ The text up to the first blank line in <MESSAGE> is treated as the release title, and the rest is used as release description in Markdown format. - If multiple <MESSAGE> options are given, their values are concatenated as - separate paragraphs. + When multiple '--message' are passed, their values are concatenated with a + blank line in-between. + + When neither '--message' nor '--file' were supplied to 'release create', a + text editor will open to author the title and description in. -F, --file <FILE> - Read the release title and description from <FILE>. + Read the release title and description from <FILE>. Pass "-" to read from + standard input instead. See '--message' for the formatting rules. -e, --edit - Further edit the contents of <FILE> in a text editor before submitting. + Open the release title and description in a text editor before submitting. + This can be used in combination with '--message' or '--file'. -o, --browse Open the new release in a web browser. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/features/api.feature new/hub-2.12.8/features/api.feature --- old/hub-2.12.6/features/api.feature 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/features/api.feature 2019-10-03 02:46:27.000000000 +0200 @@ -280,6 +280,22 @@ {"name":"Jet","size":2} """ + Scenario: Enterprise GraphQL + Given I am "octokitten" on git.my.org with OAuth token "FITOKEN" + Given the GitHub API server: + """ + post('/api/graphql', :host_name => 'git.my.org') { + halt 401 unless request.env['HTTP_AUTHORIZATION'] == 'token FITOKEN' + json :name => "Ed" + } + """ + And $GITHUB_HOST is "git.my.org" + When I successfully run `hub api graphql -f query=QUERY` + Then the output should contain exactly: + """ + {"name":"Ed"} + """ + Scenario: Repo context Given I am in "git://github.com/octocat/Hello-World.git" git repo Given the GitHub API server: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/features/compare.feature new/hub-2.12.8/features/compare.feature --- old/hub-2.12.6/features/compare.feature 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/features/compare.feature 2019-10-03 02:46:27.000000000 +0200 @@ -21,18 +21,14 @@ Scenario: No args, no upstream When I run `hub compare` Then the exit status should be 1 - And the stderr should contain: - """ - Usage: hub compare [-uc] [<USER>] [[<START>...]<END>] - hub compare [-uc] [-b <BASE>] - """ + And the stderr should contain exactly "the current branch 'master' doesn't seem pushed to a remote" Scenario: Can't compare default branch to self Given the default branch for "origin" is "develop" And I am on the "develop" branch with upstream "origin/develop" When I run `hub compare` Then the exit status should be 1 - And the stderr should contain "Usage: hub compare" + And the stderr should contain exactly "the branch to compare 'develop' is the default branch" Scenario: No args, has upstream branch Given I am on the "feature" branch with upstream "origin/experimental" @@ -48,6 +44,20 @@ Then the output should not contain anything And "open https://github.com/mislav/dotfiles/compare/my%23branch!with.special%2Bchars" should be run + Scenario: Current branch pushed to fork + Given I am "monalisa" on github.com with OAuth token "MONATOKEN" + And the "monalisa" remote has url "[email protected]:monalisa/dotfiles.git" + And I am on the "topic" branch pushed to "monalisa/topic" + When I successfully run `hub compare` + Then "open https://github.com/mislav/dotfiles/compare/monalisa:topic" should be run + + Scenario: Current branch with full URL in upstream configuration + Given I am on the "local-topic" branch + When I successfully run `git config branch.local-topic.remote https://github.com/monalisa/dotfiles.git` + When I successfully run `git config branch.local-topic.merge refs/remotes/remote-topic` + When I successfully run `hub compare` + Then "open https://github.com/mislav/dotfiles/compare/monalisa:remote-topic" should be run + Scenario: Compare range When I successfully run `hub compare 1.0...fix` Then the output should not contain anything @@ -81,7 +91,7 @@ When I run `hub compare -b experimental` Then "open https://github.com/mislav/dotfiles/compare/experimental...experimental" should not be run And the exit status should be 1 - And the stderr should contain "Usage: hub compare" + And the stderr should contain exactly "the branch to compare 'experimental' is the same as --base\n" Scenario: Compare base with parameters Given I am on the "master" branch with upstream "origin/master" @@ -105,6 +115,11 @@ Then the output should not contain anything And "open https://github.com/mislav/dotfiles/compare/henrahmagix:master...2b10927" should be run + Scenario: Compare 2-dots range with slashes in branch names + When I successfully run `hub compare one/foo..two/bar/baz` + Then the output should not contain anything + And "open https://github.com/mislav/dotfiles/compare/one/foo...two/bar/baz" should be run + Scenario: Complex range is unchanged When I successfully run `hub compare @{a..b}..@{c..d}` Then the output should not contain anything diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/features/release.feature new/hub-2.12.8/features/release.feature --- old/hub-2.12.6/features/release.feature 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/features/release.feature 2019-10-03 02:46:27.000000000 +0200 @@ -387,6 +387,32 @@ https://github.com/mislav/will_paginate/releases/v1.2.0\n """ + Scenario: Create a release from file + Given the GitHub API server: + """ + post('/repos/mislav/will_paginate/releases') { + assert :name => "Epic New Version", + :body => "body\ngoes\n\nhere" + + status 201 + json :html_url => "https://github.com/mislav/will_paginate/releases/v1.2.0" + } + """ + And a file named "message.txt" with: + """ + Epic New Version + + body + goes + + here + """ + When I successfully run `hub release create -F message.txt v1.2.0` + Then the output should contain exactly: + """ + https://github.com/mislav/will_paginate/releases/v1.2.0\n + """ + Scenario: Create a release with target commitish Given the GitHub API server: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/github/config.go new/hub-2.12.8/github/config.go --- old/hub-2.12.6/github/config.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/github/config.go 2019-10-03 02:46:27.000000000 +0200 @@ -192,7 +192,7 @@ } func getPassword() (string, error) { - stdin := 0 // syscall.Stdin + stdin := int(syscall.Stdin) initialTermState, err := terminal.GetState(stdin) if err != nil { return "", err diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/github/http.go new/hub-2.12.8/github/http.go --- old/hub-2.12.6/github/http.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/github/http.go 2019-10-03 02:46:27.000000000 +0200 @@ -229,6 +229,11 @@ } func (c *simpleClient) performRequest(method, path string, body io.Reader, configure func(*http.Request)) (*simpleResponse, error) { + if path == "graphql" { + // FIXME: This dirty workaround cancels out the "v3" portion of the + // "/api/v3" prefix used for Enterprise. Find a better place for this. + path = "../graphql" + } url, err := url.Parse(path) if err == nil { url = c.rootUrl.ResolveReference(url) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/go.mod new/hub-2.12.8/go.mod --- old/hub-2.12.6/go.mod 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/go.mod 2019-10-03 02:46:27.000000000 +0200 @@ -1,6 +1,6 @@ module github.com/github/hub -go 1.12 +go 1.11 require ( github.com/BurntSushi/toml v0.3.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/script/build new/hub-2.12.8/script/build --- old/hub-2.12.6/script/build 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/script/build 2019-10-03 02:46:27.000000000 +0200 @@ -14,7 +14,6 @@ build_hub() { mkdir -p "$(dirname "$1")" go build \ - $MOD_VENDOR_ARG \ -ldflags "-X github.com/github/hub/version.Version=`./script/version` $LDFLAGS" \ -gcflags "$GCFLAGS" \ -asmflags "$ASMFLAGS" \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/script/github-release new/hub-2.12.8/script/github-release --- old/hub-2.12.6/script/github-release 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/script/github-release 2019-10-03 02:46:27.000000000 +0200 @@ -17,8 +17,12 @@ assets+=( -a "${filename}#${label}" ) done +notes="$(git tag --list "v${version}" --format='%(contents:subject)%0a%0a%(contents:body)')" + if hub release --include-drafts | grep -q "^v${version}\$"; then hub release edit "v${version}" -m "" "${assets[@]}" +elif [ $(wc -l <<<"$notes") -gt 1 ]; then + hub release create ${pre:+--prerelease} -F - "v${version}" "${assets[@]}" <<<"$notes" else { echo "${project_name} ${version}" echo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/script/test new/hub-2.12.8/script/test --- old/hub-2.12.6/script/test 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/script/test 2019-10-03 02:46:27.000000000 +0200 @@ -33,7 +33,8 @@ check_formatting() { [[ "$(go version)" != *" go1.8."* ]] || return 0 - make fmt >/dev/null + gofmt -l -w . >/dev/null + git checkout -- vendor if ! git diff -U1 --exit-code; then echo echo "Some go code was not formatted properly." >&2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hub-2.12.6/version/version.go new/hub-2.12.8/version/version.go --- old/hub-2.12.6/version/version.go 2019-09-21 17:30:41.000000000 +0200 +++ new/hub-2.12.8/version/version.go 2019-10-03 02:46:27.000000000 +0200 @@ -6,7 +6,7 @@ "github.com/github/hub/git" ) -var Version = "2.12.6" +var Version = "2.12.8" func FullVersion() (string, error) { gitVersion, err := git.Version()
