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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 06, 2023 at 06:07:29PM +0100, René Scharfe wrote:
> > 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.

> > 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux