vscode-open-in-github icon indicating copy to clipboard operation
vscode-open-in-github copied to clipboard

Setting to open file in current commit instead of branch?

Open rolodato opened this issue 8 years ago • 3 comments

@ziyasal thanks for building this extension, much appreciated!

When opening a file in GitHub, the URL that gets opened is in the format:

https://github.com/USER/REPO/blob/BRANCH/PATH/FILENAME#LINENUMBER

I would like the following instead (canonical format):

https://github.com/USER/REPO/blob/COMMIT_HASH/PATH/FILENAME#LINENUMBER

That way I can easily share the link with others (maybe a copy link to clipboard option?). It's not a big deal since pressing y in GitHub's UI switches to the canonical format. Would you accept a PR for this feature?

rolodato avatar Jan 03 '17 16:01 rolodato

Note that this is not the same as #47 - that issue is about opening the latest non-pushed commit. I'm only looking for the current commit.

rolodato avatar Jan 03 '17 16:01 rolodato

This is actually quite important because when I'm on master, create a-new-branch locally and invoke "Open in GitHub" on any file, I get 404 because the branch doesn't exist on GitHub yet. Using commit hash is the only safe way, used e.g. by IntelliJ IDEs.

borekb avatar Jan 24 '17 10:01 borekb

Is this addressed by https://github.com/ziyasal/vscode-open-in-github/commit/32ae2700e5bd80df58942e97211bf649ea13d9cd?

jwulf avatar Apr 27 '18 01:04 jwulf