fzf-git.sh icon indicating copy to clipboard operation
fzf-git.sh copied to clipboard

"open in browser" is maybe a bit too generic

Open Vampire opened this issue 3 months ago • 4 comments

As far as I understood this just supports the GitHub URL scheme. As you cannot know whether a given URL has a GitHub installation behind you probably cannot optionally display and register the action only for GitHub instances, but maybe it would be useful to clarify the wording like "open on GitHub" instead.

Vampire avatar Oct 15 '25 10:10 Vampire

clarify the wording like "open on GitHub" instead.

Having it once in the README seems sufficient.

https://github.com/junegunn/fzf-git.sh/blob/279050e2eba5b9f4c5b057ca7dbc7e02e67315a1/README.md?plain=1#L63-L65

LangLangBart avatar Oct 17 '25 05:10 LangLangBart

I disagree. Many people do not read readmes or just the installation part and if they do - like me - they forget it again. The UI is what you see on each usage and that should be as intuitive as possible, and I think "Open on GitHub" is much more appropriate and intuitive then "Open in Browser". The maintainer might object of course, after all it is just my 2ct. 🤷‍♂️

Another alternative would be to make the URL scheme configurable. On our work-project e.g. a gitweb URL would work and it would be nice if it worked.

Vampire avatar Oct 17 '25 07:10 Vampire

https://github.com/junegunn/fzf-git.sh/blob/279050e2eba5b9f4c5b057ca7dbc7e02e67315a1/fzf-git.sh#L110

We may support other services in the future. For example, see https://github.com/junegunn/fzf-git.sh/pull/72.

junegunn avatar Oct 18 '25 14:10 junegunn

Supporting other services might also be nice, yeah. But could you then maybe make the pattern configurable? If you have a repo where you cannot derive the service from the remote URL, you still have to use something by default or fail-early. If there were some setting, you could make it work. So for example some fzf-git-specific Git config key. This should then support pre-provided settings like

  • fzf-git.open-in-browser-pattern = "github"
  • fzf-git.open-in-browser-pattern = "gitlab"
  • fzf-git.open-in-browser-pattern = "azure-dev-ops"
  • fzf-git.open-in-browser-pattern.tag = "/-/tags/<tagName>"
  • fzf-git.open-in-browser-pattern.tag = "https://git.company.com/gitweb/?p=my-repo.git;a=tag;h=refs/tags/<tagName>"

and so on.

Vampire avatar Oct 20 '25 11:10 Vampire