bgreenlee / sublime-github

Sublime Text 2/3 plugin that provides a number of useful commands for GitHub.
MIT License
455 stars 98 forks source link

Getting errors trying to open in browser github with files from submodule or not-master branch #100

Closed allomov closed 8 years ago

allomov commented 8 years ago

Hey @bgreenlee. First of all thank you for a very helpful plugin. I consider to include it in everyday workflow.

Still there are some things that I aware of: I can't open in browser files that are part of submodules or located inside repo that is not checkout to master. Here you can see screenshots of the errors:

error with submodule

error with non-master branch

bgreenlee commented 8 years ago

If you're not in a branch or have no upstream configured, and that file exists in master, you can use the version of the command that always uses master:

github-master

Sorry for the confusion. I could add a hint to the error message.

allomov commented 8 years ago

Yeah, I see. At the moment I am working with this option, but still going to master every time is not so convenient.

I am sure it is possible to implement this feature, but I am not confident with sublime plugins to create a PR. Could you tell what are the problems behind implementing such functional?

bgreenlee commented 8 years ago

So one thing I could do that would be pretty easy is to use master if there's no upstream branch configured. Would that help?

Also, I haven't used submodules much, but if you're in a submodule, would you want it to open up the code in that submodule's repo? I assume that would be possible.

Here's the chunk of code that figures out what url to open: https://github.com/bgreenlee/sublime-github/blob/7cd0deccfd67abe6d2a9f1ce703ad2843dd2d662/sublime_github.py#L423-L492

allomov commented 8 years ago

Thank you for pointing this. I will see what is possible to do.