You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
await api.v3(repos/${user}/${repo}/git/refs/heads);
Gives all the branches
Only make the call after the user clicks?
The benefit of using v3 for the branches is that we get all of them at once
To create is
POST /repos/:owner/:repo/git/refs
OR
use V4 and only get that branch info, then use v3 to create the branch
Why do you keep asking this? I said it before. Is this going to be like your last PR of me saying the same thing 4 different ways before the code was updated?
Sometimes I need to rebase a PR I'm working on (e.g. start from scratch with a different implementation) and I don't want to lose the current progress.
Activity
yakov116 commentedon Mar 15, 2020
Only way it through v3 api
https://gist.github.com/potherca/3964930
fregante commentedon Mar 15, 2020
You can already clone it:
yakov116 commentedon Mar 15, 2020
@fregante wow I never knew that!!
fregante commentedon Mar 15, 2020
If this “Duplicate” button is added to the Branches page, it can replace this feature request: #2500, also because renaming isn’t a safe operation
yakov116 commentedon Mar 15, 2020
@fregante curious why is renaming not a safe option?
fregante commentedon Mar 15, 2020
Explained in #2500: it doesn’t move PRs
yakov116 commentedon Mar 15, 2020
@fregante like this? Or do you want to hack the drop down menu?
fregante commentedon Mar 15, 2020
If v3 only requires a
fetchwe can use that instead of v4, we don't get about itsbodyanywayfregante commentedon Mar 15, 2020
On https://github.com/sindresorhus/refined-github/branches
deletebuttonprompt("cancel" or empty name will cancel the action)await api.v3(...)location.reload())yakov116 commentedon Mar 15, 2020
They both require 2 calls. One to get the commit the brach is up to. And one to create the branch.
Creating the branch via V3 is simple.
fregante commentedon Mar 15, 2020
Ugh. The GraphQL schema for this is awful. Private IDs should not be exposed at all.
Two v3 calls are fine since it's a specific user action.
This is not exactly a high-priority feature though.
yakov116 commentedon Mar 15, 2020
await api.v3(
repos/${user}/${repo}/git/refs/heads);Gives all the branches
Only make the call after the user clicks?
The benefit of using v3 for the branches is that we get all of them at once
To create is
POST /repos/:owner/:repo/git/refs
OR
use V4 and only get that branch info, then use v3 to create the branch
fregante commentedon Mar 15, 2020
The last OR sounds good. V4 GET, V3 POST
yakov116 commentedon Mar 15, 2020
V3 I can get the direct info
fregante commentedon Mar 15, 2020
What’s direct info? V4 also has the commit info, it’s just what we need. V4 requests are light, v3 GET requests aren’t
yakov116 commentedon Mar 15, 2020
await api.v3(
repos/${user}/${repo}/git/refs/heads/${branchName!});yakov116 commentedon Mar 15, 2020
I have every thing done I am having a hard time making a post
fregante commentedon Mar 15, 2020
Why do you keep asking this? I said it before. Is this going to be like your last PR of me saying the same thing 4 different ways before the code was updated?
yakov116 commentedon Mar 15, 2020
No no. I know I know. Your right.
It was a mistake that line got in there
fregante commentedon Mar 19, 2020
@szmarczak why do you need to clone a branch?
yakov116 commentedon Mar 19, 2020
Owh... I thought you closed the issue
szmarczak commentedon Mar 19, 2020
Sometimes I need to rebase a PR I'm working on (e.g. start from scratch with a different implementation) and I don't want to lose the current progress.
fregante commentedon Mar 19, 2020
Commits aren't lost, you just need to save the commit hash
szmarczak commentedon Mar 19, 2020
IKR, but I'm lazy to do so :(
szmarczak commentedon Mar 19, 2020
I think that the
clone-branchfeature would be a safer option :)