github / docs

The open-source repo for docs.github.com
https://docs.github.com
Creative Commons Attribution 4.0 International
16.1k stars 59.27k forks source link

Mention new "OWNER:REPO:BRANCH" pattern in "Comparing across forks" #34381

Open muzimuzhi opened 3 weeks ago

muzimuzhi commented 3 weeks ago

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/pull-requests/committing-changes-to-your-project/viewing-and-comparing-commits/comparing-commits#comparing-across-forks

What part(s) of the article would you like to see updated?

The section Comparing across forks only mentions the OWNER:BRANCH pattern to specify a compare branch in a three-dot comparison, but recently GitHub started using a new OWNER:REPO:BRANCH pattern.

To compare branches on different repositories, preface the branch names with user names. For example, by specifying octocat:main for base and octo-org:main for compare, you can compare the main branch of the repositories respectively owned by octocat and octo-org.

Here's an example of a comparison between two repositories.

The new pattern can be found in the URL of "Open pull request" pages. Such pages can be opened by visiting https://github.com/OWNER/REPO/pull/new/BRANCH or by clicking the "Open pull request" button in the page of a branch ahead of upstream default branch.

For example,

Additional information

The old form OWNER:BRANCH still works, though I don't know which one is preferable by the GitHub.

For example, https://github.com/github/docs/compare/main...muzimuzhi:gh34381-update-basehead-form?expand=1 still works.

nguyenalex836 commented 3 weeks ago

@muzimuzhi Thank you for opening an issue! I'll get this triaged for review ✨

muzimuzhi commented 3 weeks ago

The corresponding API docs may need a similar update, for example the doc of basehead path parameter of REST API endpoint for "Compare to commits".

Not sure if there are any similar GraphQL APIs.

github-actions[bot] commented 1 week ago

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes: