-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show base commit in PRs (and not just the base branch) #3863
Comments
This would use the same API call needed for |
Maybe there's a shorter way but this works pretty well: {
repository(<...>) {
pullRequest(number: <number>) {
commits(first: 1) {
nodes {
commit {
parents(first: 1) {
nodes { oid }
}
}
}
}
}
}
} Will try to open a PR today if I can find the time. |
@cheap-glitch That doesn't work because it always uses the first commit’s parent, but actually the base can change with a merge commit:
Your query would return C, but GitHub compares the files with F. Our current For this feature we can use this value for now. My question is just: where do we show this piece of information? |
What if we turn HEAD is 3 commits behind BASE (abcdefg). [Update branch] This would not appear when the PR is up to date and that's ok. We'd show the banner regardless of conflicts and native "update branch" buttons. We can preserve this logic just to determine whether to show our Update button: |
@fregante is this the style you had in mind? if (pageDetect.isEnterprise()) {
position.append(' ', (
<span className="status-meta d-inline-block rgh-update-pr-from-base-branch">
You can <button type="button" className="btn-link">update the base branch</button>.
</span>
));
} else {
position.append(' ', (
<span className="status-meta d-inline-block">
{select('.head-ref')!.cloneNode(true)} is {prInfo.headRef.compare.behindBy} commits behind {select('.base-ref')!.cloneNode(true)}
{' '}(<a className="btn-link" href={buildRepoURL('commits/' + prInfo.baseRefOid)}>{prInfo.baseRefOid.slice(0, 8)}</a>)
[<button type="button" className="btn-link rgh-update-pr-from-base-branch">update branch</button>].
</span>
)); |
Love it. I didn't know where to display it, but that makes sense. We can figure out the exact design later |
OK we need to merge #6103 first and then I can work on it |
PRs show the base branch, but they don't tell how long ago the current branch was updated. Example:
In this case, this feature would tell us that
C
is the real baseI've wanted to know this in the past, but at the moment I'm only thinking of why we shouldn't implement this: 😅
update-pr-from-base-branch
feature already tells us whether it's up to date and it allows us to update itDiscussion welcome. Would this info be useful? When?
The text was updated successfully, but these errors were encountered: