The Wayback Machine - https://web.archive.org/web/20160820044511/https://github.com/github/VisualStudio/issues/343
Skip to content

Link generation for Open/Link to GitHub should use the latest commit of the current file #343

Open
grokys opened this Issue Jun 3, 2016 · 3 comments

3 participants

@grokys

The "Open on GitHub" feature always seems to try to open the file on master - if I'm on a branch that file might not exist or be completely different. It would be good to open the file on the correct branch on the site.

@shana shana closed this Jun 7, 2016
@shana
shana commented Jun 7, 2016 edited

It's more that it generates the url based on the latest commit on that branch... maybe what we should do is generate the link based on the latest commit for that particular file, so even if you haven't pushed this particular branch, the link still points to the right place.

@shana shana reopened this Jun 7, 2016
@shana shana changed the title from "Open on GitHub" doesn't take current branch into account to Link generation for Open/Link to GitHub should use the latest commit of the current file Jun 7, 2016
@paladique paladique self-assigned this Jun 15, 2016
@shana shana added the bug label Jul 4, 2016
@paladique
GitHub member
paladique commented Jul 27, 2016 edited

maybe what we should do is generate the link based on the latest commit for that particular file

Does this mean we should go back through the log and find the first commit present on the repo/remote? If so what we're thinking is using git branch -r --contains TheSHA (via libgit2sharp) to find the latest commit on the remote and use that SHA if it exists.

That example in the link is using local heads, but we could tweak it to find remotes with that commit.

@shana

Yup, that sounds right 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can't perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.