Skip to content

Support line ranges in :Gbrowse for commits #36

Description

@odnoletkov

It would be great to have :{range}Gbrowse working for commit objects. Especially useful for doing code reviews.

Sample URL:

https://github.com/tpope/vim-rhubarb/commit/b6cbbb0ad3e22870a3cd8d79a22722c63d98d18b#diff-fa7310c9e56a98e1e812ae6c04353771R43

Anchor format is:

#diff-<md5 of path>[L|R]<line number>

with L line number is relative to the origin, with R to the result

Couldn't find a way to select a range in this view, for selected range can either route to the first line or to the cursor position.

As far as I understand for commit fugitive currently doesn't provide path and line numbers, changing that should be most of the work.

Activity

  1. tpope commented on Jan 8, 2019

    @tpope
    Owner

    The basic logic for figuring out the diff line can be found in s:StageInfo(). I'd recommend duplicating it as a starting point. (Don't try to DRY it up.)

    If a range is given, I'd say just use the first line of it, regardless of where the cursor is.

  2. lucasdf commented on Sep 18, 2019

    @lucasdf

    hey @odnoletkov , it seems you implemented something like this in your fork. Are you planning to integrate it into the plugin?

  3. odnoletkov commented on Sep 18, 2019

    @odnoletkov
    SponsorAuthor

    See #37

  4. tpope commented on Sep 18, 2019

    @tpope
    Owner

    Note the linked Fugitive PR is a prerequisite and the current bottleneck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions