Thread (4 messages) 4 messages, 2 authors, 2016-06-15

Re: [PATCH] describe: when failing, tell the user about options that work

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:36

Possibly related (same subject, not in this thread)

Thomas Rast [off-list ref] writes:
Junio C Hamano wrote:
quoted
Thomas Rast [off-list ref] writes:
quoted
@@ -259,7 +260,14 @@ static void describe(const char *arg, int last_one)
 			printf("%s\n", find_unique_abbrev(sha1, abbrev));
 			return;
 		}
-		die("cannot describe '%s'", sha1_to_hex(sha1));
+		if (unannotated_cnt)
+			die("cannot describe '%s'"
+			    " with only\nannotated tags. Try --tags.",
Did you mean UNannotated tags here?
No, but I think I see where the misunderstanding came from.

This code path means that we did not find a tag to describe with, but
we counted some unannotated tags (and because of how the counting
logic is wrapped, this only triggers when neither --all nor --tags are
in effect).
I think I read the code right ;-).
So I wanted it to say "it is impossible to describe this with the tags
you told me to use", which in this case are the annotated ones.
The way I read it was "it is impossible to describe it in the way you told
me to, when the tags you have are only unannotated kind."
However, it could be written e.g.

  No annotated tags can describe '%s'.  However, there were
  unannotated tags: try --tags.
Sounds better.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help