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

Fix :Gbrowse in "detached HEAD" state #730

Closed
wants to merge 1 commit into from
Closed

Fix :Gbrowse in "detached HEAD" state #730

wants to merge 1 commit into from

Conversation

junegunn
Copy link

@junegunn junegunn commented Dec 9, 2015

Closes #646.

This patch tries to find the right URL for HEAD when in detached HEAD state. If there's a matching tag on HEAD (e.g. git checkout v2.2) it will use it, otherwise, SHA. This is my attempt to fix the issue without fully understanding the codebase, so maybe I'm doing something incredibly wrong here and if there's a better way to handle this, feel free to close this PR. Actually I couldn't figure out what ^\d\=$ is supposed to match, but I noticed that it matches empty string in detached HEAD state.

@tpope tpope closed this in 207c643 Dec 11, 2015
@tpope
Copy link
Owner

tpope commented Dec 11, 2015

This code is slated to be replaced by rhubarb.vim going forward. I've backported all changes from there which appears to solve the problem.

I'm not sure how I feel about the tag matching behavior. It's definitely useful but I think I might prefer something a bit more explicit. One thing I can say for sure is that it needs to live in s:Browse() instead of being GitHub specific, if you are interested in pursuing further.

wadkar pushed a commit to wadkar/vim-fugitive that referenced this pull request Dec 16, 2015
brendeschuijmert pushed a commit to brendeschuijmert/vim-fugitive that referenced this pull request Aug 6, 2019
brendeschuijmert added a commit to brendeschuijmert/vim-fugitive that referenced this pull request Apr 13, 2020
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

Successfully merging this pull request may close these issues.

:Gbrowse doesn't do the right thing when on a detached HEAD.
2 participants