All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Taylor Blau <me@ttaylorr.com>
Cc: "René Scharfe" <l.s.r@web.de>, git@vger.kernel.org
Subject: Re: [PATCH 4/7] revision, rev-parse: factorize incompatibility messages about --exclude-hidden
Date: Thu, 7 Dec 2023 08:10:04 +0100	[thread overview]
Message-ID: <ZXFvzAb93otxIPjs@tanuki> (raw)
In-Reply-To: <ZXDKjdOiIdHipaKy@nand.local>

[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]

On Wed, Dec 06, 2023 at 02:25:01PM -0500, Taylor Blau wrote:
> 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.

Does our i18n tooling know how to extract such messages defined in
macros? I have to admit I don't really know how it works under the hood.
But if it does work then this looks like a good solution to me.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-12-07  7:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 11:51 [PATCH 0/7] standardize incompatibility messages René Scharfe
2023-12-06 11:51 ` [PATCH 1/7] push: use die_for_incompatible_opt4() for --delete/--tags/--all/--mirror René Scharfe
2023-12-06 11:51 ` [PATCH 2/7] repack: use die_for_incompatible_opt3() for -A/-k/--cruft René Scharfe
2023-12-06 19:18   ` Taylor Blau
2023-12-06 11:51 ` [PATCH 3/7] revision: use die_for_incompatible_opt3() for --graph/--reverse/--walk-reflogs René Scharfe
2023-12-06 13:08   ` Patrick Steinhardt
2023-12-06 13:47     ` René Scharfe
2023-12-06 17:21   ` Eric Sunshine
2023-12-06 17:29     ` René Scharfe
2023-12-06 11:51 ` [PATCH 4/7] revision, rev-parse: factorize incompatibility messages about --exclude-hidden René Scharfe
2023-12-06 13:08   ` Patrick Steinhardt
2023-12-06 14:21     ` René Scharfe
2023-12-06 14:39       ` Patrick Steinhardt
2023-12-06 17:07         ` René Scharfe
2023-12-06 19:25           ` Taylor Blau
2023-12-07  7:10             ` Patrick Steinhardt [this message]
2023-12-06 11:51 ` [PATCH 5/7] clean: factorize incompatibility message René Scharfe
2023-12-06 11:52 ` [PATCH 6/7] worktree: standardize incompatibility messages René Scharfe
2023-12-06 11:52 ` [PATCH 7/7] worktree: simplify incompatibility message for --orphan and commit-ish René Scharfe
2023-12-06 13:07 ` [PATCH 0/7] standardize incompatibility messages Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZXFvzAb93otxIPjs@tanuki \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=me@ttaylorr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.