You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show base commit in PRs (and not just the base branch) #3863
@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:
master A-B-C-D-E-F
\ \
feature-branch C-Q-Z-Y
Your query would return C, but GitHub compares the files with F. Our current baseRefOid already updates correctly, except when there's a force push.
For this feature we can use this value for now. My question is just: where do we show this piece of information? restore-file and update-pr-from-base-branch should already have queried all the necessary information here.
What if we turn update-pr-from-base-branch into a panel like:
HEADis3commitsbehindBASE(abcdefg).[Updatebranch]
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:
if(pageDetect.isEnterprise()){position.append(' ',(<spanclassName="status-meta d-inline-block rgh-update-pr-from-base-branch">
You can <buttontype="button"className="btn-link">update the base branch</button>.
</span>));}else{position.append(' ',(<spanclassName="status-meta d-inline-block">{select('.head-ref')!.cloneNode(true)} is {prInfo.headRef.compare.behindBy} commits behind {select('.base-ref')!.cloneNode(true)}{' '}(<aclassName="btn-link"href={buildRepoURL('commits/'+prInfo.baseRefOid)}>{prInfo.baseRefOid.slice(0,8)}</a>)
[<buttontype="button"className="btn-link rgh-update-pr-from-base-branch">update branch</button>].
</span>));
Activity
fregante commentedon Jun 5, 2022
This would use the same API call needed for
restore-fileoccasionally restores the wrong commit #4679cheap-glitch commentedon Jun 8, 2022
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.
fregante commentedon Jul 22, 2022
@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
baseRefOidalready updates correctly, except when there's a force push.For this feature we can use this value for now. My question is just: where do we show this piece of information?
restore-fileandupdate-pr-from-base-branchshould already have queried all the necessary information here.fregante commentedon Jul 22, 2022
What if we turn
update-pr-from-base-branchinto a panel like: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:
update-pr-from-base-branchwhen there are conflicts #5768)yakov116 commentedon Oct 30, 2022
@fregante is this the style you had in mind?
fregante commentedon Oct 30, 2022
Love it. I didn't know where to display it, but that makes sense. We can figure out the exact design later
yakov116 commentedon Oct 30, 2022
OK we need to merge #6103 first and then I can work on it