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

GBrowse from GBlame #1214

Closed
tenderlove opened this issue Feb 21, 2019 · 3 comments
Closed

GBrowse from GBlame #1214

tenderlove opened this issue Feb 21, 2019 · 3 comments

Comments

@tenderlove
Copy link

Hi,

When I'm viewing a blame, often I want to look at the commit on GitHub. I'd like something like GBrowse, but it navigates to the commit that corresponds to the sha that's under my cursor. I didn't see any shortcuts for doing this in the docs, so I made one:

augroup fugitive_ext
  autocmd!
  " Browse to the commit under my cursor
  autocmd FileType fugitiveblame nnoremap <buffer> <localleader>gb :execute ":Gbrowse " . expand("<cword>")<cr>
augroup END

I guess this is a "feature request" or a "did I not read the docs completely?" request.

Thanks!

@tenderlove
Copy link
Author

Btw, the main reason I want to view the commit on GitHub is because I'd like to figure out what PR the commit goes with and look at the PR. I'm working on a thing to do that too, but I thought I'd mention why I want to view the commit on GitHub rather than just look at the diff locally.

@tpope
Copy link
Owner

tpope commented Feb 21, 2019

There's no direct way to do this without also temporarily navigating to the commit object. It would be a pretty reasonable behavior to put on :.Gbrowse, though, especially if paired with #1171. Let's centralize further discussion there.

@tpope tpope closed this as completed Feb 21, 2019
tpope added a commit that referenced this issue Apr 7, 2021
If a line number is given, browse to the commit on that line.
Otherwise, browse to the file, same as if called from the original
buffer.

It would probably make more sense to open the corresponding blame page
on providers that support it, but that will have to wait on an API
change.

References #1214
@tpope
Copy link
Owner

tpope commented Apr 7, 2021

This is now supported on 2 interfaces:

  • :.GBrowse - this might switch to opening GitHub's blame view if support for that is ever implemented.
  • :GBrowse <cfile> - this won't change to that, so it's the preferred interface if you're creating a map or otherwise wrapping it.

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

2 participants