delimiter
delimiter copied to clipboard
Allow saving via pull request
Allow a fork-and-PR workflow for unauthorised users, and a branch-and-PR workflow for authorised users.
So UI-wise, I'm thinking of having two saving options, similar to the UI of editing a file within github.com. By default, the "save directly" option will be selected. If the logged-in user doesn't have write access to the repository, it will disable the "save directly" option and select the "fork" option.

When you fill in a message and click save, it will need to:
- Fork the repo (fortunately if you already have a fork github's api will not create a second)
- Make a commit to your fork
- Create a pull request against the upstream repo
The questions I have are:
A. Is it always reasonable to automatically create the PR on their behalf, using the commit message / summary as the body of the PR? Or should we be giving them more control over that part? (My hope is the former)
B. Once saving is complete, we usually redirect back to the /edit/
page for further editing. But with the fork-and-pr feature your changes would no longer be there because you're still editing the upstream file. Should we just redirect you to your fork? If so, I imagine there should be some visual indicator that we've done so. This does of course raise the question of upstream getting ahead of your fork :/
How about something like this?

Perhaps when you edit a file, it checks to see if you have a fork of it and applies your changes to it. When you untick the box, it shows the upstream instead.
It gets a little more nuanced for scenarios like a working branch that hasn't been "proposed" in a PR yet, and the whole concept of multiple branches in your fork, but perhaps we can figure that out.
I would say the former is a bit simpler (i.e. first option).