-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
* Show the commit the line came from in the title window. * Show the commit where annotating starts in the status window.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,6 +234,10 @@ blame_read(struct view *view, struct buffer *buf, bool force_stop) | |
update_view_title(view); | ||
redraw_view_from(view, 0); | ||
} | ||
|
||
if (view->env->ref[0]) | ||
update_status("Start annotating from %s", view->env->ref); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ilyagr
|
||
|
||
return true; | ||
} | ||
|
||
|
@@ -355,7 +359,7 @@ blame_go_forward(struct view *view, struct blame *blame, bool parent) | |
const char *filename = parent ? commit->parent_filename : commit->filename; | ||
|
||
if (!*id && parent) { | ||
report("The selected commit has no parents"); | ||
report("The selected commit has no parents with this file"); | ||
return; | ||
} | ||
|
||
|
@@ -474,10 +478,13 @@ blame_select(struct view *view, struct line *line) | |
if (!commit) | ||
return; | ||
|
||
if (string_rev_is_null(commit->id)) | ||
if (string_rev_is_null(commit->id)) { | ||
string_ncopy(view->env->commit, "HEAD", 4); | ||
else | ||
string_format(view->ref, "%s", commit->filename); | ||
} else { | ||
string_copy_rev(view->env->commit, commit->id); | ||
string_format(view->ref, "%s changed %s", commit->id, commit->filename); | ||
} | ||
|
||
if (strcmp(commit->filename, view->env->file)) | ||
string_format(view->env->file_old, "%s", commit->filename); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ assert_equals 'blame-default.screen' <<EOF | |
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 26| | ||
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 27| lazy val parent: Projec | ||
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 28| id = "parent", | ||
[blame] project/Build.scala - line 1 of 64 43% | ||
[blame] 90286e0752016a6bca30dfa7ca236d1f99345eb8 changed project/Build.scala 43% | ||
This comment has been minimized.
Sorry, something went wrong.
ilyagr
|
||
EOF | ||
|
||
assert_equals 'blame-with-diff.screen' <<EOF | ||
|
@@ -69,7 +69,7 @@ assert_equals 'blame-with-diff.screen' <<EOF | |
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 7| | ||
4779f9b Jonas Fonseca 2013-11-26 20:13 -0500 8| object ScalaJSBenchmarks | ||
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 9| | ||
[blame] project/Build.scala - line 4 of 64 14% | ||
[blame] 74537d9b257954056d3caa19eb3837500aded883 changed project/Build.scala 14% | ||
commit 74537d9b257954056d3caa19eb3837500aded883 | ||
Author: Sébastien Doeraene <[email protected]> | ||
AuthorDate: Tue Oct 29 18:46:52 2013 +0100 | ||
|
@@ -101,7 +101,7 @@ assert_equals 'blame-with-diff-no-file-filter.screen' <<EOF | |
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 7| | ||
4779f9b Jonas Fonseca 2013-11-26 20:13 -0500 8| object ScalaJSBenchmarks | ||
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 9| | ||
[blame] project/Build.scala - line 4 of 64 14% | ||
[blame] 74537d9b257954056d3caa19eb3837500aded883 changed project/Build.scala 14% | ||
commit 74537d9b257954056d3caa19eb3837500aded883 | ||
Author: Sébastien Doeraene <[email protected]> | ||
AuthorDate: Tue Oct 29 18:46:52 2013 +0100 | ||
|
@@ -152,5 +152,5 @@ assert_equals 'blame-parent-of-74537d9.screen' <<EOF | |
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 26| | ||
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 27| lazy val benchmarkSettings = | ||
90286e0 Jonas Fonseca 2013-10-14 13:15 -0400 28| unmanagedSources in (Com | ||
[blame] project/Build.scala - line 4 of 66 42% | ||
[blame] 90286e0752016a6bca30dfa7ca236d1f99345eb8 changed project/Build.scala 42% | ||
EOF |
Thank you for working on this!
I think this specific message is, unfortunately, not very helpful as is. Perhaps it'd be more helpful if you mentioned the parent commit, e.g. "Start annotating from parent(s) of 395611"? Perhaps we can think of something else?
Here's why I think it is confusing. I did
tig src/blame.c
while on thiswip-gh-1315
branch, and then pressed,
on the first line. This results in a message "Start annotating from 0a7f...". However, the commit starting with 0a7f is nowhere to be seen on screen, nor was it on screen before I pressed,
. (It's actually the commit before 395611 that was selected before you pressed,
, but is nowhere on screen after you press,
. This makes sense, in a way, but I had to quittig
and reopen it with the log view to find it.).A message like "Start annotating from parent(s) of 395611" still has the downside that once you see the message, that commit is no longer visible on screen, but it will be clear for people who looked at what the selected commit was before they pressed
,
.