Re: [PATCH] branch: issue "-l" deprecation warning after pager starts
From: Junio C Hamano <hidden>
Date: 2018-05-26 02:37:48
Jeff King [off-list ref] writes:
quoted
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).
Needless to tell you, I worked backwards when noticing that these three warning() lines are not marked for translation ;-). But of course, fixing this in a naïve way will involve memory allocation during execution of die(), which may well be due to OOM, which is why we knew the need but haven't found a good solution to it.