Refined-github: Link to commit page from PR commit

Created on 30 Jan 2018  路  17Comments  路  Source: sindresorhus/refined-github

PR commit:

https://github.com/sindresorhus/refined-github/pull/1045/commits/b7137144f3df9a77f80c78ca63bf43322b2cf621

Commit page:

https://github.com/sindresorhus/refined-github/commit/b7137144f3df9a77f80c78ca63bf43322b2cf621

The commit page still has things missing from the PR commit page like:

  • the conversation for a commit
  • the commit parent
  • a different rendering of the changed files.

Could we link the commit hash on the PR commit page to the commit-specific page?

enhancement good first issue help wanted

All 17 comments

@bfred-it Just noticed the link shortener produces a bug here.

Converts that:

https://github.com/sindresorhus/refined-github/pull/1045/commits/b7137144f3df9a77f80c78ca63bf43322b2cf621

to

https://github.com/sindresorhus/refined-github/commit/b7137144f3df9a77f80c78ca63bf43322b2cf621

No, that's GitHub itself. The shortener doesn't change the href

No, that's GitHub itself. The shortener doesn't change the href

SAD :(

Live example in this comment: https://github.com/sindresorhus/refined-github/issues/212#issuecomment-317926159

We can't fix this, the original link does not appear in the DOM.

The only solution we could offer would be during the _posting_ of a link by wrapping the raw link with []() and GitHub won't break it.

I'm reporting it to GitHub, please do so too, even if just by copy-pasting this:

https://github.com/contact

Commit link shortening bug: PR commit links only link to the commit
This is a PR commit link:

https://github.com/sindresorhus/refined-github/pull/1119/commits/0f51dfe30eb36e60369a188786d88b6e421f1543

Paste that into a comment, you'll see that it's shortened to "0f51dfe" and it will link to:

https://github.com/sindresorhus/refined-github/commit/0f51dfe30eb36e60369a188786d88b6e421f1543

Which is a link outside the PR, it's a different view.

Bug initially reported in: https://github.com/sindresorhus/refined-github/issues/1053

Does the GitHub bug block the original request? I'm not sure I entirely follow what the problem is but there are already .patch and .diff links that work correctly; the commit link is almost the same so it feels like it should be possible to extract it somehow and use it to linkify the commit hash as well?

@borekb Check out this link:

https://github.com/sindresorhus/refined-github/pull/1045/commits/b7137144f3df9a77f80c78ca63bf43322b2cf621

Refined GitHub is taking care of linkifying it so it works correctly and you will see the commit inside PR #1045.

Now here's the same link pasted directly without wrapping it in <pre>:

https://github.com/sindresorhus/refined-github/pull/1045/commits/b7137144f3df9a77f80c78ca63bf43322b2cf621

As you can see, GitHub shortens it to be a commit link... but forgets the PR part. Opening it will not show anything related to the PR #1045

Sorry, I might be slower today but I think the feature request is this (@hkdobrev, please correct me if I'm wrong):

image

How is this related to linkification inside the comment box?

@borekb I might have missed that point entirely.

Could we link the commit hash on the PR commit page to the commit-specific page?

@hkdobrev to clarify, do you want to link this

To this page?

If yes, why?

@borekb I think you're right, I got distracted by the GitHub bug.

Thanks for confirming, in my case, the reasons are similar to the OP:

  • The commit page has slightly different (sometimes preferable) rendering
  • The commit might be in multiple PRs, the commit page links to them
  • There might be conversation for the plain commit
  • The commit page shows commit parent

It's a small convenience, in my opinion similar to linkifying a branch name on the PR page.

good first issue, I might take it to contribute back to this awesome project! Can I start working on it or does this issue need further confirmation that this is something that you, maintainers, are interested in happening?

Yeah you can go ahead

PR: #1429. Most of the time, I didn't know what I was doing :) But making live changes to a Chrome extension was an interesting experience.

@lukehefson can we solve this long-standing papercut? 馃槄 https://github.com/sindresorhus/refined-github/issues/1053#issuecomment-375200239

I'll dig in!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juliocanares picture juliocanares  路  3Comments

MilesBHuff picture MilesBHuff  路  3Comments

alexanderadam picture alexanderadam  路  3Comments

Arcanemagus picture Arcanemagus  路  3Comments

Celthi picture Celthi  路  3Comments