From c5124725413ff38f0e4680920dd0182ce900444d Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Mar 16 2020 19:37:38 +0000 Subject: Merge branch 'master' into epel8 --- diff --git a/.gitignore b/.gitignore index e69de29..238d0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,30 @@ +*.src.rpm +/hub-635646f7f39c7747f9cb06cf15c3c0c37520706b.tar.gz +/hub-e807a3891b13a45d52447b63ca4e54c25a78dc13.tar.gz +/hub-748c1359b33e3f6af843d7b9eaaf990e563a8449.tar.gz +/hub-2.2.5-7988c4b.tar.gz +/hub-2.2.9-80948b0.tar.gz +/hub-2.3.0-80948b0.tar.gz +/hub-2.4.0.tar.gz +/hub-prerelease-bec1441.tar.gz +/hub-prerelease-e8a7d79.tar.gz +/hub-prerelease-a9a497c.tar.gz +/hub-2.5.0.tar.gz +/hub-2.5.1.tar.gz +/hub-2.6.0.tar.gz +/hub-2.7.1.tar.gz +/hub-2.8.3.tar.gz +/hub-2.8.4.tar.gz +/hub-2.9.0.tar.gz +/hub-2.10.0.tar.gz +/hub-2.10.1.tar.gz +/hub-2.11.1.tar.gz +/hub-2.11.2.tar.gz +/hub-2.12.0.tar.gz +/hub-2.12.1.tar.gz +/hub-2.12.2.tar.gz +/hub-2.12.7.tar.gz +/hub-2.12.8.tar.gz +/hub-2.13.0.tar.gz +/hub-2.14.0.tar.gz +/hub-2.14.2.tar.gz diff --git a/0001-Use-system-cucumber.patch b/0001-Use-system-cucumber.patch new file mode 100644 index 0000000..4e37d20 --- /dev/null +++ b/0001-Use-system-cucumber.patch @@ -0,0 +1,26 @@ +From 4f2dadd1a654033e2731a4954ab3da0efe09f369 Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher +Date: Wed, 23 Jan 2019 03:08:52 -0500 +Subject: [PATCH 1/2] Use system cucumber + +Signed-off-by: Stephen Gallagher +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 23b6368c103ffac9ad438b053a67a81b7cb2ca19..f4efff65f25515d513c6f443583844fcaafb12c2 100644 +--- a/Makefile ++++ b/Makefile +@@ -66,7 +66,7 @@ else + endif + + bin/cucumber: +- script/bootstrap ++ ln -s /usr/bin/cucumber bin/cucumber + + fmt: + go fmt ./... +-- +2.23.0 + diff --git a/0002-Use-blackfriday.v2.patch b/0002-Use-blackfriday.v2.patch new file mode 100644 index 0000000..ab65415 --- /dev/null +++ b/0002-Use-blackfriday.v2.patch @@ -0,0 +1,40 @@ +From 18dffc3b09cccdd18e90cd966397da681bb9a3e3 Mon Sep 17 00:00:00 2001 +From: Stephen Gallagher +Date: Wed, 17 Jul 2019 15:59:02 -0400 +Subject: [PATCH 2/2] Use blackfriday.v2 + +Signed-off-by: Stephen Gallagher +--- + md2roff-bin/cmd.go | 2 +- + md2roff/renderer.go | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/md2roff-bin/cmd.go b/md2roff-bin/cmd.go +index cf77de1f692a2519dc24dc442f81562f4457afac..907dae0449901585c93dbce033580bb11d419203 100644 +--- a/md2roff-bin/cmd.go ++++ b/md2roff-bin/cmd.go +@@ -13,7 +13,7 @@ import ( + + "github.com/github/hub/md2roff" + "github.com/github/hub/utils" +- "github.com/russross/blackfriday" ++ "gopkg.in/russross/blackfriday.v2" + ) + + var ( +diff --git a/md2roff/renderer.go b/md2roff/renderer.go +index 9b0a75357e35966db62e9fa7317cee7b47c4738b..bbf66b27aea710d25c8d3009e5697ac86df94bc4 100644 +--- a/md2roff/renderer.go ++++ b/md2roff/renderer.go +@@ -8,7 +8,7 @@ import ( + "strconv" + "strings" + +- "github.com/russross/blackfriday" ++ "gopkg.in/russross/blackfriday.v2" + ) + + // https://github.com/russross/blackfriday/blob/v2/markdown.go +-- +2.23.0 + diff --git a/hub-commits.py b/hub-commits.py new file mode 100644 index 0000000..1103fb3 --- /dev/null +++ b/hub-commits.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 + +import requests +import json +import click + + +@click.command() +@click.argument('base', nargs=1) +@click.argument('head', nargs=1) +def cli(base, head): + r = requests.get('https://api.github.com/repos/github/hub/compare/%s...%s' % (base, head)) + + data = r.json() + + if not data['status'] == 'ahead': + raise IOError("Branches are divergent") + + for commit in data['commits']: + print("- ", commit['commit']['message'].split('\n')[0]) + + +def main(): + cli(obj={}) + + +if __name__ == "__main__": + main() diff --git a/hub-latest.sh b/hub-latest.sh new file mode 100755 index 0000000..1399cd9 --- /dev/null +++ b/hub-latest.sh @@ -0,0 +1,22 @@ +#!/usr/bin/bash + +REPO_URI=https://github.com/github/hub +OLD_COMMIT=$(grep "%global commit" hub.spec |cut -d ' ' -f3) +HEAD_COMMIT=$(git ls-remote $REPO_URI HEAD | cut -f1) + +sed -i "/%global commit/c\%global commit $HEAD_COMMIT" hub.spec + +spectool -g hub.spec + +CHANGELOG=$(/usr/bin/python3 hub-commits.py $OLD_COMMIT $HEAD_COMMIT 2>/dev/null) +if [ $? ]; then + CHANGELOG= +fi + +rpmdev-bumpspec hub.spec -c "Updating to upstream commit $HEAD_COMMIT" + +TARBALL=hub-prerelease-${HEAD_COMMIT:0:7}.tar.gz +echo "Uploading $TARBALL to Fedora" + +fedpkg new-sources $TARBALL + diff --git a/hub.spec b/hub.spec new file mode 100644 index 0000000..be2743b --- /dev/null +++ b/hub.spec @@ -0,0 +1,358 @@ +# Generated by go2rpm +%bcond_without check + +# https://github.com/github/hub +%global goipath github.com/github/hub +Version: 2.14.2 + +%gometa + +%global common_description %{expand: +Hub is a command line tool that wraps git in order to extend it with extra +features and commands that make working with GitHub easier. + + $ hub clone rtomayko/tilt + + # expands to: + $ git clone git://github.com/rtomayko/tilt.git} + +%global golicenses LICENSE +%global godocs CODE_OF_CONDUCT.md CONTRIBUTING.md README.md + +Name: hub +Release: 1%{?dist} +Summary: Command-line tool that makes git easier to use with GitHub + +License: MIT +URL: %{gourl} +Source0: %{gosource} + +# Fedora: use system cucumber +Patch0001: 0001-Use-system-cucumber.patch + +# Use blackfriday.v2 +Patch0002: 0002-Use-blackfriday.v2.patch + +BuildRequires: golang(github.com/atotto/clipboard) +BuildRequires: golang(github.com/BurntSushi/toml) +BuildRequires: golang(github.com/kballard/go-shellquote) +BuildRequires: golang(github.com/mattn/go-colorable) +BuildRequires: golang(github.com/mattn/go-isatty) +BuildRequires: golang(github.com/mitchellh/go-homedir) +BuildRequires: golang(golang.org/x/crypto/ssh/terminal) +BuildRequires: golang(golang.org/x/net/http/httpproxy) +BuildRequires: golang(gopkg.in/russross/blackfriday.v2) +BuildRequires: golang(gopkg.in/yaml.v2) +BuildRequires: git-core +BuildRequires: rubygem-cucumber +BuildRequires: vim-filesystem +BuildRequires: groff-base + +Requires: git-core +Requires: vim-filesystem + +%if %{with check} +# Tests +BuildRequires: golang(github.com/bmizerany/assert) +%endif + +%description +%{common_description} + +%prep +%goprep +%patch0001 -p1 +%patch0002 -p1 + +%build +mkdir -p bin +export LDFLAGS="-X github.com/github/hub/version.Version=%{version} " +%gobuild -o %{gobuilddir}/bin/hub %{goipath} +%gobuild -o bin/md2roff github.com/github/hub/md2roff-bin + + +export GO111MODULE=off +export LC_ALL=C.UTF-8 +export GOPATH=%{gopath}:$(pwd)/_build +ln -s %{gobuilddir}/bin/hub bin/hub +%make_build man-pages + +%install +install -m 0755 -vd %{buildroot}%{_bindir} +install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ + +# Install man and vim files +for src in share/man/*/*.1 share/vim/vimfiles/*/*.vim; do + dest="%{buildroot}%{_prefix}/${src}" + mkdir -p "${dest%/*}" + install -pm 0644 "$src" "$dest" +done + +# Bash-completion +install -dm 755 %{buildroot}%{_datadir}/bash-completion/completions/ +cp -p etc/hub.bash_completion.sh %{buildroot}%{_datadir}/bash-completion/completions/hub + +# ZSH-completion +install -dm 755 %{buildroot}%{_datadir}/zsh/site-functions/ +cp -p etc/hub.zsh_completion %{buildroot}%{_datadir}/zsh/site-functions/_hub + +# FISH-completion +install -dm 755 %{buildroot}%{_datadir}/fish/completions/ +cp -p etc/hub.fish_completion %{buildroot}%{_datadir}/fish/completions/hub.fish + + +%if %{with check} +%check +%gocheck +%endif + +%files +%license LICENSE +%doc CODE_OF_CONDUCT.md CONTRIBUTING.md README.md +%{_bindir}/hub +%{_mandir}/man1/* +%{_datadir}/zsh/site-functions/_hub +%{_datadir}/bash-completion/completions/hub +%{_datadir}/fish/completions/hub.fish +%{_datadir}/vim/vimfiles/ftdetect/pullrequest.vim +%{_datadir}/vim/vimfiles/syntax/pullrequest.vim + +%changelog +* Mon Mar 16 2020 Stephen Gallagher - 2.14.2-1 +- Update to 2.14.2 + +* Wed Jan 29 2020 Fedora Release Engineering - 2.14.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Jan 21 2020 Stephen Gallagher - 2.14.0-1 +- Update to 2.14.0 + +* Wed Nov 06 2019 Stephen Gallagher - 2.13.0-1 +- Update to 2.13.0 + +* Thu Oct 03 2019 Stephen Gallagher - 2.12.8-1 +- Update to 2.12.8 + +* Mon Sep 23 2019 Stephen Gallagher - 2.12.7-1 +- Update to 2.12.7 +- Add support for fish shell completion + +* Thu Jul 25 2019 Fedora Release Engineering - 2.12.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Jul 19 2019 Stephen Gallagher - 2.12.3-1 +- Update to 2.12.3 + +* Wed Jul 17 2019 Stephen Gallagher - 2.12.2-1 +- Update to 2.12.2 + +* Mon Jun 17 2019 Robert-André Mauchin - 2.12.0-100 +- Rework packaging for new F31+ golang guidelines +- Update to 2.12.0 +- Features + * Add hub api --paginate option to automatically fetch all pages of results + * Add hub pr show [] command to open a pull request in the browser + * Add hub pull-request --no-maintainer-edits flag to disallow project + maintainers being able to push to your branch + * Abort hub pull-request with a helpful error message if the current branch + wasn't pushed to a git remote + * hub issue -M now accepts milestone names instead of just numbers + * Drop support for legacy hub.http-clone git config value +- Fixes + * Fix querying git configuration when GIT_TRACE is used + * Support detached HEAD if hub pull-request --head was passed + * Fix newline in hub create error message + * Ensure HTTP connection reuse across API calls + +* Mon Apr 22 2019 Stephen Gallagher - 2.11.2-1 +- Update to 2.11.2 +- Avoid crash in hub remote argument parsing +- Fix `hub -C mydir merge ` by propagating global git arguments to + Before/After chains +- Preserve tilde ~ character in man pages + +* Fri Mar 29 2019 Stephen Gallagher - 2.11.1-1 +- Update to 2.11.1 +- Fix compatibility with git when run with no arguments: hub --git-dir=.git +- Fix issue/PR --format %L output in no-color mode +- Create draft pull requests with hub pull-request --draft +- Fix non-draft pull requests for certain repositories + +* Thu Mar 28 2019 Stephen Gallagher - 2.10.1-1 +- Update to 2.10.1 +- Fix writing over existing cache files in hub api +- Allow repository names that start with a - character +- List api among custom hub commands in help + +* Thu Feb 28 2019 Stephen Gallagher - 2.10.0-2 +- Install bash-completion into the correct path (BZ #1683866) + +* Mon Feb 25 2019 Stephen Gallagher - 2.10.0-1 +- Update to 2.10.0 +- Features + * New hub pr --format fields %pS and %pC for PR state and color + %pS: "open", "draft", "merged", or "closed" + %pC: green, gray, purple, or red + * Have commands with rich output respect the --color flag + default: --color=auto + --color is equivalent to --color=always + --color=never disables color for TTYs +- Fixes + * Make man pages parseable with whatis + * Make hub checkout work independently of remote refspec + +* Wed Feb 13 2019 Stephen Gallagher - 2.9.0-1 +- Update to 2.9.0 +- Features + * Add support for hub ci-status --format string + * Add hub create --remote-name flag + * Allow passing in a raw request body via hub api --input + * Cache HTTP 4xx (except 403) server responses in hub api --cache +- Fixes + * Ensure consistent ordering of hub ci-status -v results + * Avoid crashing on invalid GitHub hostname + * Fix parsing empty string within command-line arguments + +* Mon Feb 11 2019 Stephen Gallagher - 2.8.4-1 +- Update to 2.8.4 +- Drop DWARF decompression patch +- Use Fedora compiler and linker flags + +* Fri Feb 01 2019 Fedora Release Engineering - 2.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Jan 23 2019 Stephen Gallagher - 2.7.1-1 +- Update to 2.7.1 +- https://github.com/github/hub/releases/tag/v2.7.1 +- https://github.com/github/hub/releases/tag/v2.7.0 + +* Thu Nov 01 2018 Stephen Gallagher - 2.6.0-1 +- Update to 2.6.0 +- https://github.com/github/hub/releases/tag/v2.6.0 +- Features + * Use "scissors" line to delineate comments in editable messages instead of + stripping away lines that start with # + * New command `hub issue show ` + * Add `hub release show --format=` functionality + * `hub pr list --format=%rs` lists requested reviewers + * Add support for communicating with GitHub Enterprise over Unix socket +- Fixes + * Prevent `hub create` setting a public upstream when creating a private repo + * Fix `hub release create/edit/delete` when there are multiple git remotes + * Auto-detect private/pushable repos in `hub remote add` + * Fix `hub ci-status` exit code when there is only Checks + * Allow `hub compare ` even if not on any branch + * Ensure consistent sort direction when listing issues, PRs + * Match requested team names by slug instead of name in + `hub pull-request -r ` + +* Fri Sep 28 2018 Stephen Gallagher - 2.5.1-1 +- Update to 2.5.1 +- hub issue create: ignore the .github/ISSUE_TEMPLATE directory instead of + crashing +- hub pull-request: avoid re-requesting reviewers in case of CODEOWNERS +- hub ci-status: handle cases when Checks API is unavailable, like older + GitHub Enterprise +- Handle HTTP 422 message format from server response +- Ignore crash for malformed ~/.config/hub file +- Clarify hub init -g documentation that it doesn't imply hub create +- hub clone: add more documentation about git protocol used + +* Tue Jul 17 2018 Stephen Gallagher - 2.5.0-2 +- Fix generation of debuginfo for F29 + +* Mon Jul 16 2018 Stephen Gallagher - 2.5.0-1 +- Update to 2.5.0 +- Features + * Have ci-status also query Checks API +- Fixes + * Do not pass '--cmd' to vi editor to ensure compatibility with older vi + * Simplify cherry-picking commits from pull request URLs + * Allow single-character branches/tag names in hub compare + * Fix hub compare for Enterprise when is specified + * Support remote add -t BRANCH argument + * Bash shell completion fixes for git 2.18 + * Documentation fixes + +* Thu Jun 14 2018 Stephen Gallagher - 2.4.0-2 +- Don't own manpage directory + +* Wed Jun 13 2018 Stephen Gallagher - 2.4.0-1 +- Release hub 2.4.0 +- https://github.com/github/hub/releases/tag/v2.4.0 + +* Fri Jun 01 2018 Stephen Gallagher - 2.3.0-1 +- Release hub 2.3.0 +- https://github.com/github/hub/releases/tag/v2.3.0 + +* Wed Feb 07 2018 Fedora Release Engineering - 2.2.9-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Aug 02 2017 Fedora Release Engineering - 2.2.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 2.2.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Mar 01 2017 Stephen Gallagher - 2.2.9-3 +- Rebuild for golang bug that caused segfaults + +* Fri Feb 10 2017 Fedora Release Engineering - 2.2.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Nov 17 2016 Stephen Gallagher - 2.2.9-1 +- Update to latest stable release 2.2.9 + +* Wed Sep 28 2016 Stephen Gallagher - 2.2.5-3 +- Really fix location of ZSH completion script + +* Tue Sep 13 2016 Stephen Gallagher - 2.2.5-2 +- Fix location of ZSH completion script + +* Wed Aug 31 2016 Stephen Gallagher - 2.2.5-1 +- Update to new (and latest) major release of hub +- Include ZSH completion script + +* Wed Feb 03 2016 Fedora Release Engineering - 1.12.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Sep 11 2015 Ralph Bean - 1.12.4-5 +- Adjust ownership of bash_completion file/dir. + +* Fri Sep 11 2015 Ralph Bean - 1.12.4-4 +- Ship bash completion file. + +* Wed Jun 17 2015 Fedora Release Engineering - 1.12.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed May 27 2015 Ralph Bean - 1.12.4-2 +- Require ruby (for ruby-mri. jruby and hub don't get along.) + https://bugzilla.redhat.com/show_bug.cgi?id=1225254 + +* Wed Apr 22 2015 Ralph Bean - 1.12.4-1 +- New version +- Stop building with rdoc for now because its being so squirrely. + +* Sat Jun 07 2014 Fedora Release Engineering - 1.12.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 28 2014 Ralph Bean - 1.12.1-1 +- Latest upstream. + +* Thu May 22 2014 Ralph Bean - 1.12.0-4 +- Add -doc subpackage with rdoc product. +- Add check section, but left it commented out due to dep issues. +- Remove spurious man files. +- Remove weirdly nested docs from rdoc. + +* Wed Apr 02 2014 Ralph Bean - 1.12.0-3 +- Update Source0 URL to use the github guidelines. +- Replace weird %%prep %%setup stuff with something more familiar. + +* Wed Apr 02 2014 Ralph Bean - 1.12.0-2 +- Remove version from the doc directory. +- Replace install macro with just "install". + +* Mon Mar 31 2014 Ralph Bean - 1.12.0-1 +- Initial packaging for Fedora + diff --git a/package.cfg b/package.cfg index 66ea79d..7e5a05b 100644 --- a/package.cfg +++ b/package.cfg @@ -1,2 +1,2 @@ [koji] -targets = epel8 epel8-playground \ No newline at end of file +targets = epel8 epel8-playground diff --git a/sources b/sources index e69de29..d0edbdd 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (hub-2.14.2.tar.gz) = 4809d12966cc983f42c8aef482e07bc4226e25fc4deba838e418664ce14ac9d2ac42842d0721a46466a80c0e492392542ecfaaccc2cea0efdd60df8b60a3ca02