Skip to content

Clarify and hopefully align fork vs. upstream preferences #9170

Closed

Description

@billygriffin

Describe the feature or problem you’d like to solve

Currently, there are several places in GitHub Desktop where how the interaction should work in the app when someone is on a fork is highly dependent on someone's relationship to the project. In other words, are they on the fork because they're just trying to contribute to the upstream repo? Is this a "long-running" fork that's intended to diverge entirely from upstream? Something else? In talking through this, we think there may be several connected elements that may operate similarly depending on the preference.

Creating an issue

Using fork to contribute to upstream: Create new issue in upstream repo (documented in #9232)
Using fork to contribute to fork: Create issue in fork repo

Creating a pull request

Using fork to contribute to upstream: Create PR from fork targeting upstream
Using fork to contribute to fork: Create PR from fork targeting fork (this represents a divergence from the default behavior of GitHub.com, which by default targets new PRs toward upstream)

Viewing list of pull requests in the PR tab of the branch list

Using fork to contribute to upstream: View pull requests for the upstream repo
Using fork to contribute to fork: View pull requests for the fork repo

Staying up to date

Using fork to contribute to upstream: Ability to easily stay up to date with latest from upstream repo's default branch
Using fork to contribute to fork: Ability to easily stay up to date with latest from fork

Any others?

These are the ones we've discussed, but there may be other things that likely depend on this preference about whether you're on a fork with the intention of contributing back to upstream, or on a fork because that's where you're contributing to.


My biggest question is whether these are always consistent across these scenarios. In other words, is there ever a time where someone would want to create a PR targeting upstream by default but want to create an issue in their fork (and any of the other combinations)? I think even if that is the case, we could make the defaults align along the lines described here, and give people flexibility to change them.

Activity

  1. ampinsk commented on Mar 2, 2020

    @ampinsk
    Contributor

    @billygriffin and I chatted through this and landed in a much clearer place! So we're talking about two different kinds of forks, "Contribution Forks", where I am using this fork solely for contributing to the upstream parent project, and "Maintained Forks" a fork of a project that I use for my own purposes.

    We realized that github.com pretty strongly discourages Maintained Forks in several ways:

    1. When you create a PR from a fork, it always automatically defaults the target branch as the parent.
    2. GitHub.com redirects you from your fork's PR page (https://github.com/ampinsk/desktop/compare, for example) to the parent (https://github.com/desktop/desktop/compare)
    3. When you create a fork, it has issues disabled automatically
    4. When you have a fork from a private repo, all the forks get deleted

    Due to the friction this presents, we're under a new assumption that anyone who wants to maintain a fork for a long period of time has likely created an entirely new repo, breaking the official "fork" connection.


    For Desktop's purposes, we believe now it's safe for us to assume as a default that forks will want to interact with the upstream, meaning from the above list, we should default to:

    Upstream default

    • Create new issues in the upstream repo
    • Create PRs from fork targeting upstream
    • View pull requests for the upstream repo
    • Ability to easily stay up to date with latest from upstream repo's default branch

    We do believe it is worth it - if simple to implement - to have a repository level setting to allow you to switch to view and interact with your own fork. This setting would default to:

    Maintained fork setting: aka, treating it as a normal repo

    • Create issues in fork repo
    • Create PRs from fork targeting fork (this would require a divergence to how dotcom operates)
    • View pull requests for the fork repo
    • Ability to easily stay up to date with latest from fork

    No matter what, we should be clear about what it is that we're showing and doing (for example, the pull requests list should indicate what list of pull requests we're showing).

    I'll update with designs for:

    • Indicating what repo's pull requests the list is showing
    • How to stay up to date with upstream's changes

    Does this all make sense? Is there anything else we need designs for?

  2. rafeca commented on Mar 19, 2020

    @rafeca
    Contributor

    @tierninho pointed out an interesting behaviour in #9316 (review) .

    Whenever we decide to implement the distinction between "contribution forks" and "maintained forks",
    I think we can make use of the local git repository configuration to differentiate between both of them: if the local git repository had an upstream remote pointing to the parent repository of the origin remote repository we can assume it's a "contribution fork" and in any other case we can assume it's a "maintained fork".

  3. billygriffin commented on Apr 16, 2020

    @billygriffin
    ContributorAuthor

    This issue mostly served as kicking off the discussion, and I think we've got other issues where we'll hash out the details so I'm going to close this one - we can obviously reference it as needed. Thanks so much to @ampinsk for thinking through all these scenarios in such detail with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions