sindresorhus/refined-github

Can RG recommend me the command to fetch a PR locally? #2767

gurrrung posted onGitHub

Sometimes you want to pull a PR locally to test and it's really some work when you have to do something like

git fetch remote_name pull/PR_No/head:Branch_name Eg: git fetch origin pull/1234/head:pr-1234

Read more at: https://blog.scottlowe.org/2015/09/04/checking-out-github-pull-requests-locally/

Can Refined Github suggest the command itself by doing the hard work of sorting the PR_No and Branch_name itself?

I think it's also possible to suggest a remote_name too by checking if the username of user matches the owner of the repo.

Example: https://github.com/substack/browser-launcher/pull/35


GitHub does it already, check the links near the Merge button. Or just use hub cli tool

posted by fregante about 5 years ago

@fregante That Github option is only for the owner of repo who has merge access, I am asking it for people who don't have merge access but still want to help by reviewing the PR. I think that's the whole point of Open Source. I don't want to use hub cli that's why I requested it.

posted by gurrrung about 5 years ago

Indeed, reopening a little longer for discussion, however the point of hub is to avoid repetitive actions like this. Why not use an existing tool that does the job better?

posted by fregante about 5 years ago

It's not a bad idea to integrate it in Refined-Github itself, I guess. The second thing is newcomers don't always know the tools like hub (Thanks for suggesting it to me). When I wanted to fetch a PR from someones's repo, I googled and it gave me the above article which explains the normal way instead of suggesting hub which does the job better. (a newbie perspective) I'm sure must be pro devs who don't know about hub too and want to contribute to Open source, this can simplify that.

posted by gurrrung about 5 years ago

Honestly I would suggest this to GitHub themselves; this text should be added by them:

<img width="828" alt="" src="https://user-images.githubusercontent.com/1402241/74151828-f846cd00-4c47-11ea-88e7-850c158ef1b0.png">

However I wouldn't mind adding a couple of "click to pull" buttons on all PRs (also replacing that text on PRs you can merge):

  • one button copies hub pull $url
  • the other button is a GitHub Desktop link, like the one appearing above

<img width="920" alt="" src="https://user-images.githubusercontent.com/1402241/74151732-c7ff2e80-4c47-11ea-944c-e02f1bac5169.png">

posted by fregante about 5 years ago

There’s also an alternative UI to consider/copy, maybe we don’t need this feature at all, GitHub is already working on it. We just need to tell them to add it on PRs you can’t merge. Did you contact them?

https://twitter.com/_developit/status/1227325361517744128?s=20

posted by fregante about 5 years ago

I'll try contacting them.

posted by gurrrung about 5 years ago

That Github option is only for the owner of repo who has merge access

GitHub finally added this for everyone :tada:

<img width="345" alt="" src="https://user-images.githubusercontent.com/1402241/82999132-df043980-a008-11ea-9375-9207921df4cf.png">

No "classic git" commands however, they're only in the mergeability box.

We might even undo https://github.com/sindresorhus/refined-github/pull/2553 at some point

posted by fregante almost 5 years ago

PR welcome to add a third tab in that dropdown with instructions to fetch the PR with the ability to push to that origin. The dropdown only exists for maintainers, so it makes sense to include that ability.

I think the command is this, but exploration needed:

git remote add fregante https://github.com/fregante/refined-github.git
git checkout fregante/branch-of-this-pr
posted by fregante over 4 years ago

Fund this Issue

$0.00
Funded

Pull requests