`git pr -m` uses an undocumented and sometimes broken feature of GitHub
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 18.1k
- Forks
- 1.2k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 1
Description
According to
https://discourse.drone.io/t/github-claims-that-merge-refs-are-undocumented-feature/1100
The /merge refs are created only to check the mergeability. If a branch is already merged, the ref will be deleted. If no one visits the pull request page or uses the API to trigger the mergeability check, the ref will not update.
Although we could manually trigger the ref rebuild via visit the pull request web page, it would be better to find an alternative way. Maybe we could find the branch targeted by the pull request via GitHub API, and do the merge locally?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the git pr -m command and how it relies on GitHub /merge refs. Read the linked Drone discussion, then investigate the GitHub API path for finding the pull request's target branch and compare it with a local merge. Done means the command no longer depends on the undocumented ref behavior and still handles already-merged branches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, shell
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100