Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] On 404, fall back on a default branch or the repo root url #18

Open
hlissner opened this issue Dec 27, 2015 · 0 comments

Comments

@hlissner
Copy link

When browse-at-remote encounters a file whose url cannot be resolved (e.g. is untracked, or on an untracked branch, etc), an error occurs and that's that. I'd like to suggest one of the following as alternatives:

  1. It falls back to a default branch. Either master, or from a variable like browse-at-remote-default-branch.
  2. Have browse-at-remote/get-url or browse-at-remote/file-url accept an optional branch argument, then we can write it ourselves.
  3. Or it falls back to the root of the repository.

The rationale is that when I use browse-at-remote, I have a good idea of where I want to end up. If it doesn't find the exact url, I find it preferrable that it take me somewhere close to the target, rather than stop me dead in my tracks with an error.

I'd be happy to do a PR for this, if you'll let me know which approach (or another) you'd prefer.

Let me know! And thanks for this plugin by the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant