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
Such links are quite volatile, therefore, it would be awesome if Refined GitHub would add a “View link at the time of this comment” button next to such links.
This would be very similar to the existing “View repo at the time of this comment” functionality (#732), however, it would work for links to specific locations and for links to repositories other than the one where the comment was posted.
Reacted by Sindre Sorhus, Jeroen van Warmerdam, Niklas Higi, Sandro and Waldir Pimenta
@bfred-it You are assuming that the commenter meant to link to the commit at the time of the comment, but they might as well have been talking about just a file in general, which they want to show the latest version of.
I think the cleanest way would be to give a button to change all the non-perma-links to permalinks. Ideally on the whole thread. Perhaps a keyboard shortcut (as undiscoverable as that may be)
Better yet, add the "code" icon next to all non-perma-links, like we do in the comment headers. Perhaps a bit noisy but pretty straightforward.
After running into links where the line numbers didn't match anymore after some time, I believe that links to code lines should always be permalinks pointing to a specific commit.
I like the way Bitbucket implemented this: When clicking a link to a line of code, the branch name is automatically replaced by the current commit hash in window.location. This way users can always copy a real permalink pointing to the commit. It would be great if that also worked on GitHub.
For existing links in comments or links from users who don't use this great extension, I agree with the proposed solution.
Activity
fregante commentedon Sep 14, 2018
I’m wondering if this should just be automatic. It’s easier to reach the latest version than it is to reach the linked version.
sindresorhus commentedon Sep 14, 2018
@bfred-it You are assuming that the commenter meant to link to the commit at the time of the comment, but they might as well have been talking about just a file in general, which they want to show the latest version of.
fregante commentedon Sep 14, 2018
That’s why I said it’s easier to reach the latest version than the other way around. I could see why this might not be desirable though.
However if the link points to a line, I’d assume that the author meant that line at that point in time and nothing else.
I can’t think of a sensible way to do this (other than adding yet another icon next to each comment)
Perhaps in the new comment dropdown? Could the previous functionality also be moved in there?
sindresorhus commentedon Sep 17, 2018
This I agree with. Here the intention is clear.
sindresorhus commentedon Nov 7, 2018
PR welcome.
For anyone that wants this, please also send this feature request to GitHub: [email protected]
fregante commentedon Nov 7, 2018
Implemented how? We discussed a few options.
I think the cleanest way would be to give a button to change all the non-perma-links to permalinks. Ideally on the whole thread. Perhaps a keyboard shortcut (as undiscoverable as that may be)
Better yet, add the "code" icon next to all non-perma-links, like we do in the comment headers. Perhaps a bit noisy but pretty straightforward.
cuschk commentedon Dec 12, 2018
After running into links where the line numbers didn't match anymore after some time, I believe that links to code lines should always be permalinks pointing to a specific commit.
I like the way Bitbucket implemented this: When clicking a link to a line of code, the branch name is automatically replaced by the current commit hash in
window.location. This way users can always copy a real permalink pointing to the commit. It would be great if that also worked on GitHub.For existing links in comments or links from users who don't use this great extension, I agree with the proposed solution.