We just enabled community contributions to repos, a feature called âHub Pull requests and Discussionsâ. Pull requests and discussions work the same for all the repo types.
At a high level, the aim is to build a simpler version of other git hostsâ (like GitHubâs) PRs and Issues:
ref
branch directly on the source repo.If you opened a PR or discussion, are the author of the repository, or have write access to it, you can edit the discussion title by clicking on the pencil button.
If you wrote a comment or have write access to the repository, you can edit the content of the comment from the contextual menu in the top-right corner of the comment box.
You can also hide a comment. Hiding a comment is irreversible, and nobody will be able to see its content nor edit it anymore.
Letâs assume your PR number is 42.
git fetch origin refs/pr/42:pr/42
git checkout pr/42
# Do your changes
git add .
git commit -m "Add your change"
git push origin pr/42:refs/pr/42
Draft mode is the default status when opening a new Pull request from scratch in âAdvanced modeâ. With this status, other contributors know that your Pull request is under work and it cannot be merged. When your branch is ready, just hit the âPublishâ button to change the status of the Pull request to âOpenâ. Note that once published you cannot go back to draft mode.
Our Pull requests do not use forks and branches, but instead custom âbranchesâ called refs
that are stored directly on the source repo.
Git References are the internal machinery of git which already stores tags and branches.
The advantage of using custom refs (like refs/pr/42
for instance) instead of branches is that theyâre not fetched (by default) by people (including the repo âownerâ) cloning the repo, but they can still be fetched on demand.
You can tweak your local refspec to fetch all Pull requests:
git fetch origin refs/pr/*:refs/remotes/origin/pr/*
git checkout pr/{PR_NUMBER}
# for example: git checkout pr/42
git push origin pr/{PR_NUMBER}:refs/pr/{PR_NUMBER}
# for example: git push origin pr/42:refs/pr/42