Thread (9 messages) flat view 9 messages, 4 authors, 2018-05-29

Re: [PATCH] branch: issue "-l" deprecation warning after pager starts

From: Jeff King <hidden>
Date: 2018-05-25 17:10:56

Possibly related (same subject, not in this thread)

On Fri, May 25, 2018 at 06:14:16PM +0900, Junio C Hamano wrote:
Junio C Hamano [off-list ref] writes:
quoted
quoted
-		warning("the '-l' alias for '--create-reflog' is deprecated;");
-		warning("it will be removed in a future version of Git");
+		if (list) {
+			warning("the '-l' option is an alias for '--create-reflog' and");
+			warning("has no effect in list mode. This option will soon be");
+			warning("removed and you should omit it (or use '--list' instead).");
+		} else {
+			warning("the '-l' alias for '--create-reflog' is deprecated;");
+			warning("it will be removed in a future version of Git");
+		}
By the way, this is one of these times when I feel that we should
have a better multi-line message support in die/error/warning/info
functions.  Ideally, I should be able to write

	warning(_("the '-l' option is an alias for '--create-reflog' and\n"
		  "has no effect in list mode, This option will soon be\n"
		  "removed and you should omit it (or use '--list' instead)."));

and warning() would:

 - do the sprintf formatting thing as necessary to prepare a long multi-line
   message;

 - chomp that into lines at '\n' boundary; and

 - give each of these lines with _("warning: ") prefixed.

That way, translators can choose to make the resulting message to
different number of lines from the original easily.
Yep, I totally agree. In past discussions I was thinking mostly of
the pain of writing these multi-line messages. But I imagine it is
absolute hell for translators, and we should fix it for that reason.

(Also, I guess this message probably ought to be marked for
translation).

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help