Refined-github: "Deep blame" for squashed commits

Created on 7 Mar 2020  路  4Comments  路  Source: sindresorhus/refined-github

  1. Visit https://github.com/sindresorhus/refined-github/blame/0ca864af6da9cac9f503e4abd0c58b60fbe1abc6/source/features/link-to-file-in-file-history.tsx#L29

There's no blame specifically for that line, there's only a big blame block. However if you follow the PR's link, (5 clicks and 4 page loads later) you'll end up on this page:

https://github.com/sindresorhus/refined-github/blame/a2f6e93ca789d2b0677e152bc28d35d4a4180175/source/features/link-to-file-in-file-history.tsx#L34


This feature would need I think:

  1. On blame page, add "deep blame this commit" button on each commit that has a PR link in its title
  2. When the button is clicked, it has to query the API to get the PR's latest commit (user will be shown a loading icon)
  3. Redirect to that commit

Step 2 should (if possible) verify that the linked PR is effectively the one that was squashed, and not just a randomly-linked PR.

enhancement under discussion

All 4 comments

I dont think we should load it on blame.

Rather allow the user to click alt and then load

{
  repository(owner: "sindresorhus", name: "refined-github") {
    object(expression: "ad17f062d53fa911c131ce1be964e1d20d5e6f72") {
      ... on Commit {
        associatedPullRequests(last: 1) {
          nodes {
            mergeCommit {
              oid
            }
            commits(last: 1) {
              nodes {
                commit {
                  oid
                }
              }
            }
          }
        }
      }
    }
  }
}

const pullRequests = select.all('[data-hovercard-type="pull_request"]')

for (const pullRequest of pullRequests) {
    console.log(pullRequest.nextElementSibling.href.split('/')[6])
}

And redirect to that commit

Side Note: @Github we changed the clock...
image

Rather allow the user to click alt and then load

Yeah that鈥檚 what I said, only after the user clicks on it because it requires a specific query per commit

Rather allow the user to click alt and then load

Yeah that鈥檚 what I said, only after the user clicks on it because it requires a specific query per commit

Alt click?
Then redirect to blame of last commit of the pr

Step 2 should (if possible) verify that the linked PR is effectively the one that was squashed, and not just a randomly-linked PR.

I was thinking to take the commit and get the associated pr with it

I added to the query the merge commit that we can compare it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sompylasar picture sompylasar  路  3Comments

olso picture olso  路  3Comments

sindresorhus picture sindresorhus  路  3Comments

mareksuscak picture mareksuscak  路  3Comments

Celthi picture Celthi  路  3Comments