From 1444a54447f424b78b8eda1171dfed1db99de471 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Tue, 13 Feb 2024 13:30:46 -0800 Subject: [PATCH] Blame: improve error messages for the `,` operation The message is now: Commit f4657f00 has no ancestors modifying the seleted line instead of The selected commit has no parents This addresses a portion of https://github.com/jonas/tig/issues/1315. Apart from being a bit clearer, the user will be able to learn what `,` is meant to do from it. In particular, they should notice that commit `f4657f00` is the commit on the selected *line*, not the commit that is currently displayed in general. Trying to press `,` a few times is a natural thing to try to do after reading the help while trying to figure out how blame works in tig. --- src/blame.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/blame.c b/src/blame.c index 785b88d91..95e20af16 100644 --- a/src/blame.c +++ b/src/blame.c @@ -355,12 +355,12 @@ 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("Commit %.8s has no ancestors modifying the selected line", commit->id); return; } if (!strcmp(history_state->id, id) && !strcmp(history_state->filename, filename)) { - report("The selected commit is already displayed"); + report("Commit %.8s is already beind displayed", commit->id); return; }