From 62ff0fb6ec53610ad39e84c330cdc9db06110b06 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. 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..da8b63577 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 seleted 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; }