Thread (20 messages) 20 messages, 4 authors, 2023-12-07

Re: [PATCH 4/7] revision, rev-parse: factorize incompatibility messages about --exclude-hidden

From: Taylor Blau <hidden>
Date: 2023-12-06 19:25:04

On Wed, Dec 06, 2023 at 06:07:29PM +0100, René Scharfe wrote:
quoted
It's not perfect
of course, but would at least ensure that we can easily convert things
over time without having to duplicate the exact message everywhere.
Maybe the simplest option would be to use a macro, e.g.

   #define INCOMPATIBLE_OPTIONS_MESSAGE \
           _("options '%s' and '%s' cannot be used together")

It could be used with both error() and die(), and the compiler would
still ensure that two strings are passed along with it, but I don't know
how to encode that requirement in the macro name somehow to make it
self-documenting.  Perhaps by getting the number two in there?
I think that this is a great idea. It nicely solves Patrick's concern
that we have to duplicate this message ID everywhere, and equally solves
yours by calling error() inline instead of having to pass down the
option values.

I think that including a number in the macro name would be helpful here.
quoted
I don't think it's a problem to not convert everything in one go. The
current series is a good step in the right direction, and any additional
instances that were missed can be fixed in follow-ups.
Right; whatever we do, we can (and should) do it step by step.
I agree :-).

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