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

Display only the specified range when blaming #978

Closed
jeenuv opened this issue Dec 20, 2019 · 1 comment · Fixed by #1190
Closed

Display only the specified range when blaming #978

jeenuv opened this issue Dec 20, 2019 · 1 comment · Fixed by #1190

Comments

@jeenuv
Copy link

jeenuv commented Dec 20, 2019

git blame supports -L option with which we can supply a range of lines to blame, and git outputs the blame for only those lines. This comes in handy when invoking from within an editor, say Vim. For example, to view the blame from lines 2000 to 2020, I could say :!git blame -L2000,2020 -- %.

Two issues with tig:

  • tig does accept the same option. However, tig outputs all lines in the file. This means, for the example above, even though I'm interested in the 20 lines towards the bottom, tig shows the whole file, and I've to scroll 2000 lines for the view I'm interested in. Any chance this can supported?
  • To tig, I've to specify it as -L2000,2020; it seems to be confused if I say -L 2000,2020, with white space after -L.
koutcher added a commit to koutcher/tig that referenced this issue May 26, 2022
koutcher added a commit to koutcher/tig that referenced this issue May 26, 2022
koutcher added a commit to koutcher/tig that referenced this issue May 26, 2022
koutcher added a commit to koutcher/tig that referenced this issue Jun 1, 2022
Change the blame view to use the porcelain output rather than loading
the file and adding blame information based on the incremental output.

Fixes jonas#978
Fixes jonas#1189

Reviewed-by: Johannes Altmanninger <aclopte@gmail.com>
koutcher added a commit to koutcher/tig that referenced this issue Jun 1, 2022
Change the blame view to use the porcelain output rather than loading
the file and adding blame information based on the incremental output.

Fixes jonas#978
Fixes jonas#1189

Reviewed-by: Johannes Altmanninger <aclopte@gmail.com>
koutcher added a commit to koutcher/tig that referenced this issue Jun 1, 2022
Change the blame view to use the porcelain output rather than loading
the file and adding blame information based on the incremental output.

Fixes jonas#978
Fixes jonas#1189

Reviewed-by: Johannes Altmanninger <aclopte@gmail.com>
koutcher added a commit that referenced this issue Jun 3, 2022
Change the blame view to use the porcelain output rather than loading
the file and adding blame information based on the incremental output.

Fixes #978
Fixes #1189

Reviewed-by: Johannes Altmanninger <aclopte@gmail.com>
@Daghall
Copy link

Daghall commented Jul 29, 2022

This is a really old issue that recently got fixed, but for what it's worth, I used the +<number> parameter (Show the first view with line visible and selected) to tig to solve this problem:

nmap <silent> <Leader>l :silent :execute "!tig blame " . shellescape(expand("%")) . " +" . line(".") <CR>:redraw!<CR>

Hitting <Leader>l opens the file in tig blame, with the line the cursor in vim was at, highlighted and centered. Hitting q returns to vim. Really handy.

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 a pull request may close this issue.

2 participants