-
Notifications
You must be signed in to change notification settings - Fork 622
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
Blame uncommitted deletions starting from HEAD #1009
Conversation
afc152f
to
ba2676e
Compare
Couldn't + if (find_deleted_line_in_head(view, line, view->env->file, &view->env->goto_lineno))
+ string_copy(view->env->ref, "HEAD");
+ else
view->env->goto_lineno = diff_get_lineno(view, line, false);
if (view->env->goto_lineno > 0)
view->env->goto_lineno--; |
This is to deal with RM files; If file However, dealing with renames here is not super important to me, maybe we should leave that out for now? |
The use case is fine, I just didn't realize that providing a pathspec to |
Addressed all comments. |
Looks good to me. As Steve used to say, one more thing: so far, @jonas has maintained compatibility with pre-C99 compilers. Can you keep variables declaration at the beginning of blocks ? Also can you check NEWS.adoc, Improvements are listed before Bug fixes. |
When starting a blame in the stage view on a deleted line, it seems appropriate to find the commit that added the line. To this end, instead of starting the blame view from the working-tree-state of a file, use the version at HEAD, which still has the deleted line (unless the line was only just staged). Compute the position of the deleted line to start the blame view there. Closes jonas#1008
Should be done now, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great improvement. Thanks.
When starting a blame in the stage view on a deleted line, it seems
appropriate to find the commit that added the line. To this end, instead
of starting the blame view from the working-tree-state of a file, use
the version at HEAD, which still has the deleted line (unless the line
was only just staged). Compute the position of the deleted line to
start the blame view there.
Closes #1008