file blame
extrawurst opened this issue · 8 comments
in our file trees we should be able to jump into a file blame mode known from all major git GUI tools.
for a first mvp it is probably enough to scroll by line and show the hash + author + date each line in a split-screen side-by-side.
from each line we should allow opening the matching commit details.
@extrawurst I’d like to give this one a try. Do you want blame mode to be part of the “Log” tab? I assume it is supposed to take over the full screen. Is that correct?
I agree it should take over the screen. Well I would suggest starting with a mock-up first just to align us on the plan. For reference check out how I did that for stashing: #3 (comment)
also look up some alternatives to get a good impression of what the user will expect. I personally tried to stay close to how fork does things.
@cruessler I think the tig way is a good starting point. just a few ideas:
- lets make the date more compact similar to what we do in the log view.
- we don't need the status bar on the bottom telling us the amount of lines, we have scroll bars in the other diffs
- I would jump into a
InspectCommit
view when you press 'enter' on one of the lines - nice improvement over tig is to combine entries on the left that are equal (merging the elements into a sort of hunk of lines that shares the same commit/author...) - this would make the view easier to read and navigate. this would be copied from the example we see in fork.
@cruessler any progress on this?
@extrawurst Yes, I’m planning to work on it this weekend and will likely be able to present the first results tomorrow.
Wow. Really looking forward to this issue being addressed!
I want to stretch this feature a bit: Is there any change to implement a subcommand to launch blame view directly? Such as gitui blame <file>
. I find it useful when integrating with other terminal tools.
Here are a example of tig integration with neovim. It will launch blame view for line under current cursor:
function! Tig(args) abort
let args = expandcmd(a:args)
tabedit
execute 'terminal tig ' . args
endfunction
command! -narg=* Tig call Tig(<q-args>)
command! Gblame execute 'Tig blame % +' . line('.')
@weihanglo thanks for your interest, I see your idea as a separate feature request. the first iteration of file-blame should be focused on getting that right so that it rocks. whether we allow opening gitui to go to specific views right on start depending on command line arguments is a different story in general.