sindresorhus/refined-github

Make the edit button on org's repo link me to editing on my fork #2812

jack1142 posted onGitHub

Example URL: https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/develop/redbot/core/core_commands.py

When I look for causes of some issue, I often look at the files in the org's repo not the forked repo on my account. Once I found the cause and the issue is easy enough to do from GitHub's site I often just click the edit button and make the needed changes. Once I do, I of course want to commit changes to a new branch and then I realise that I'm in fact on my org's repo not on my fork and I have to go to my fork and copy over what I did and commit the changes there instead (we have policy to use forks for pull requests of org members which I think isn't that rare).

I would like to propose a functionality that would make the edit button org's repo link me to my fork even if I have write permissions to org's repo.


Just because I have a fork, it doesn't necessarily mean I want to work in it.

I think #2810 would be easier and more explicit

posted by fregante about 5 years ago

Just because I have a fork, it doesn't necessarily mean I want to work in it.

I agree with that, was hoping that this function could be added being off by default but with that said I don't think there's actually is any function in this extension that is disabled by default. Anyway, wanted to at least suggest it in case there is a possibility to add it with being off by default.

posted by jack1142 about 5 years ago

@fregante Okay, so I thought of 2 other less invasive ideas (the latter probably not realistic) for this:

  1. "Edit on fork" button, similar to requested #2810 but saves a little more time by going directly to edit page

And second option that I'm guessing is probably not achievable for a not first-party solution but maybe GH allows more than I would expect...

  1. Adding a third option in the "Commit changes" form, something like this (just a quick draft of what I mean) image This would be very cool but I really doubt this could actually be possible.

Would any of these 2 be worth putting an issue for? I don't want to spam you with issues for no reason 😄

posted by jack1142 about 5 years ago

Option 2 would be perfect if the form can do that automatically (that is, just by changing the value of that radio, rather than forcing us to use the API to create the file)

posted by fregante about 5 years ago

I can't say with 100% certainty, but I doubt this is possible with just making right changes to the form. I saw same_repo hidden field in form but sending form with it set to 0 didn't change anything so I really can't think of any other way of achieving this from the form on that page image

So question is if making an issue for "Edit on fork" button (or editing this one accordingly) would be okay?

posted by jack1142 about 5 years ago

Thanks for making a new issue, that’s good. You can also add the secondary radio button screenshot. I like that one more (easier too, maybe)

posted by fregante about 5 years ago

@fregante I'm assuming you meant #2815 in this comment, so if it isn't clear from its description, #2815 refers to stuff like https://github.com/jack1142/refined-github/new/master (create/edit file on fork) page while this issue was referring to https://github.com/sindresorhus/refined-github/new/master (create/edit file on main repo) // for the sake of example, we're assuming that I have write perm to sindresorhus/refined-github

So while it would make it easier if you're on fork's "create/edit file" page, it still doesn't make it easier to edit from org's repo. #2810 would make it good enough, but the proposed here "Edit on fork" button would make it even better. Since I'm making issues that are related to similar problem I'm wondering if I should make yet another one just for the "Edit on fork" button or include that in one of the issues (I'm guessing #2810?).

The reason for putting a list in #2815 instead of secondary radio button was because there might be a few different base repositories you may want to make a pull request to.

posted by jack1142 about 5 years ago

Make the edit button on org's repo link me to editing on my fork

To cut things short, this isn’t possible. If you click Edit on this repo and end up on @you/refined-github/edit/master/file.js, the file you’re editing is not the file you saw before you clicked the button.

This is why I said that #2815 is a better solution.

posted by fregante about 5 years ago

Fund this Issue

$0.00
Funded

Pull requests