Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hub -C local_dir pr checkout N doesn't work #2612

Open
scpeters opened this issue Sep 15, 2020 · 3 comments
Open

hub -C local_dir pr checkout N doesn't work #2612

scpeters opened this issue Sep 15, 2020 · 3 comments
Labels

Comments

@scpeters
Copy link

Command attempted:

hub -C local_dir pr checkout 1

What happened:

fatal: not a git repository (or any of the parent directories): .git

More info:

$ hub version
git version 2.28.0
hub version 2.14.2
$ brew config | grep macOS
macOS: 10.14.6-x86_64

I'm able to do hub -C local_dir pr list successfully, and pushd local_dir; hub pr checkout 1; popd works, but for some reason I can't use -C local_dir with hub pr checkout.

@scpeters scpeters added the bug label Sep 15, 2020
@scpeters
Copy link
Author

I think the problem happens at the following line at the end of checkoutPr:

https://github.com/github/hub/blob/31b6443687b3a0313000f8044bffbbed0a8a9b97/commands/pr.go#L324

because the Replace method for Args wipes out the GlobalFlags:

https://github.com/github/hub/blob/93537d457500c1d9f2e5671b9b9b1ebf90a55668/commands/args.go#L57

scpeters added a commit to scpeters/hub that referenced this issue Sep 16, 2020
@scpeters
Copy link
Author

removing that line from args.go (see scpeters@b78b010) fixes the issue for me, but it's possible there are unintended side-effects of that change

@scpeters
Copy link
Author

removing that line from args.go (see scpeters@b78b010) fixes the issue for me, but it's possible there are unintended side-effects of that change

that line was explicitly added in 40e0cd2, so I'm guessing it shouldn't be removed

scpeters added a commit to gazebo-tooling/release-tools that referenced this issue Sep 16, 2020
Use pushd and popd around `hub pr checkout N`
to workaround the following hub issue:
mislav/hub#2612

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to gazebo-tooling/release-tools that referenced this issue Sep 17, 2020
Use pushd and popd around `hub pr checkout N`
to workaround the following hub issue:
mislav/hub#2612

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
scpeters added a commit to gazebo-tooling/release-tools that referenced this issue Sep 18, 2020
Build bottles in response to "build bottle" trigger
phrase in github comments rather than in response to
opening a PR or adding new commits.
Disconnect bottle builder job from pull request creator
for now.

Use hub to checkout ghprbPullId with a github token
set from the jenkins credentials store.
Use `git fetch --unshallow` explicitly with https
since test-bot will try to checkout with ssh and run into
permission problems.

Set `GITHUB_*` environment variables expected by test-bot.

* Workaround bug in `hub -C dir pr checkout N`

Use pushd and popd around `hub pr checkout N`
to workaround the following hub issue:
mislav/hub#2612

* Use OSRFUNIXBase for jobs on master

The pull request updater and pr hash updater both
run on master but are failing since #279 since
those jobs don't have a Dockerfile or build.sh.
Using OSRFUNIXBase instead of OSRFLinuxBase fixes it.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant