git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 11/11] i18n: turn even more messages into "cannot be used together" ones

From
Jean-Noël AVILA <jn.avila@free.fr>
Date
Dec 29, 2021, 15:49 UTC
Message-ID
<3237737.qFR3CMiZ0V@cayenne>
In-Reply-To
<3fdc2585-06e6-231c-621a-b719ec5d8f46@kdbg.org>
On Tuesday, 28 December 2021 08:33:15 CET Johannes Sixt wrote:
Show 16 quoted lines
> Am 28.12.21 um 00:23 schrieb Jean-Noël Avila via GitGitGadget:
> > From: =?UTF-8?q?Jean-No=C3=ABl=20Avila?= <jn.avila@free.fr>
> > diff --git a/builtin/am.c b/builtin/am.c
> > index 8677ea2348a..be0e32f69cf 100644
> > --- a/builtin/am.c
> > +++ b/builtin/am.c
> > @@ -2230,8 +2230,8 @@ static int parse_opt_show_current_patch(const struct option *opt, const char *ar
> >  	}
> >  
> >  	if (resume->mode == RESUME_SHOW_PATCH && new_value != resume->sub_mode)
> > -		return error(_("--show-current-patch=%s is incompatible with "
> > -			       "--show-current-patch=%s"),
> > +		return error(_("options '--show-current-patch=%s' and '--show-current-patch=%s' "
> > +					   "cannot used together"),
> 
> Missing "be".
Thanks.
Show 17 quoted lines
> 
> >  			     arg, valid_modes[resume->sub_mode]);
> >  
> >  	resume->mode = RESUME_SHOW_PATCH;
> > diff --git a/builtin/cat-file.c b/builtin/cat-file.c
> > index 86fc03242b8..400ceaba5e8 100644
> > --- a/builtin/cat-file.c
> > +++ b/builtin/cat-file.c
> > @@ -729,7 +729,7 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
> >  	}
> >  
> >  	if (force_path && batch.enabled) {
> > -		error("--path=<path> incompatible with --batch");
> > +		error("'--path=<path>' and '--batch' cannot be used together");
> 
> Missing "options" perhaps.
>
Thanks.
 
Show 20 quoted lines
> >  		usage_with_options(cat_file_usage, options);
> >  	}
> >  
> > diff --git a/builtin/describe.c b/builtin/describe.c
> > index fd5ba1fc604..130b87b3a34 100644
> > --- a/builtin/describe.c
> > +++ b/builtin/describe.c
> > @@ -670,9 +670,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
> >  		}
> >  		describe("HEAD", 1);
> >  	} else if (dirty) {
> > -		die(_("--dirty is incompatible with commit-ishes"));
> > +		die(_("'%s' and commit-ishes cannot be used together"), "--dirty");
> >  	} else if (broken) {
> > -		die(_("--broken is incompatible with commit-ishes"));
> > +		die(_("'%s' and  commit-ishes cannot be used together"), "--broken");
> 
> I noticed immediately that the two texts are not the same because they
> are not aligned, but it took me a few seconds to notice the extra blank
> in the second one.
Thanks.
Show 18 quoted lines
> 
> >  	} else {
> >  		while (argc-- > 0)
> >  			describe(*argv++, argc == 0);
> > diff --git a/builtin/init-db.c b/builtin/init-db.c
> > index 546f9c595e7..b85dffbdf5c 100644
> > --- a/builtin/init-db.c
> > +++ b/builtin/init-db.c
> > @@ -681,7 +681,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix)
> >  	}
> >  	else {
> >  		if (real_git_dir)
> > -			die(_("--separate-git-dir incompatible with bare repository"));
> > +			die(_("'--separate-git-dir' and bare repository cannot be used together"));
> 
> IMO, in this case, the original text is awkward, and the transformation
> is worse because it really sounds like a mechanical replacement. I
> suggest not to do this transformation.
Agreed.
Show 18 quoted lines
> >  
> >  test_fixup_reword_opt () {
> >  	test_expect_success "--fixup=reword: incompatible with $1" "
> > -		echo 'fatal: reword option of --fixup is mutually exclusive with'\
> > -			'--patch/--interactive/--all/--include/--only' >expect &&
> > +		echo 'fatal: reword option of --fixup and'\
> > +			'--patch/--interactive/--all/--include/--only'\
> > +			'cannot be used together' >expect &&
> 
> On first sight, it looked significant that there are no blanks between
> "and", the single-quote, and the backslash. On second thought, the
> backslash is just a line continuation, and the blank that is needed in
> the text is inserted by "echo" because it emits its three arguments, the
> single-quoted strings', in blank-separated form. This means that there
> must not be a blank after "and" and after "--only" and before the
> single-quotes. There could be a blank before the backslash.
> 
> Good.

That's exactly that. I struggled for quite some time when trying to split the string and the test was failing. Very counter-intuitive, even after you understand why.

Thanks for your review and spotting the mistakes. Will reroll.

As a side note, while editing all these tests in series, i could not help but notice that there are different styles of writing them.

Previous: Johannes SixtNext: Jean-Noël Avila via GitGitGadget
Message 43 of 94 in “Factorization of messages with similar meaning”
  1. 00/10 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Dec 3, 2021
  2. 02/10 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  3. 04/10 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  4. Ævar Arnfjörð BjarmasonDec 7, 2021
  5. 01/10 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  6. Ævar Arnfjörð BjarmasonDec 7, 2021
  7. Jean-Noël AVILADec 8, 2021
  8. 05/10 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Dec 3, 2021
  9. Ævar Arnfjörð BjarmasonDec 7, 2021
  10. 03/10 i18n: turn "options are incompatible" into "are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  11. 06/10 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Dec 3, 2021
  12. 08/10 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Dec 3, 2021
  13. Ævar Arnfjörð BjarmasonDec 7, 2021
  14. 07/10 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  15. 09/10 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  16. 10/10 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Dec 3, 2021
  17. Jeff KingDec 3, 2021
  18. Johannes SixtDec 3, 2021
  19. Junio C HamanoDec 5, 2021
  20. Jean-Noël AVILADec 5, 2021
  21. Johannes SixtDec 5, 2021
  22. Junio C HamanoDec 6, 2021
  23. Junio C HamanoDec 5, 2021
  24. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Dec 27, 2021
  25. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  26. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  27. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Dec 27, 2021
  28. Junio C HamanoDec 27, 2021
  29. Ævar Arnfjörð BjarmasonDec 27, 2021
  30. Junio C HamanoDec 28, 2021
  31. Jean-Noël AVILADec 29, 2021
  32. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Dec 27, 2021
  33. Johannes SixtDec 28, 2021
  34. Jean-Noël AVILADec 29, 2021
  35. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  36. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  37. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  38. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  39. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Dec 27, 2021
  40. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Dec 27, 2021
  41. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Dec 27, 2021
  42. Johannes SixtDec 28, 2021
  43. Jean-Noël AVILADec 29, 2021
  44. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Dec 29, 2021
  45. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  46. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  47. Junio C HamanoDec 30, 2021
  48. Jean-Noël AVILADec 31, 2021
  49. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  50. Johannes SixtDec 29, 2021
  51. Jean-Noël AVILADec 30, 2021
  52. Junio C HamanoDec 30, 2021
  53. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  54. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Dec 29, 2021
  55. René ScharfeJan 1, 2022
  56. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Dec 29, 2021
  57. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  58. Junio C HamanoDec 30, 2021
  59. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Dec 29, 2021
  60. Junio C HamanoDec 30, 2021
  61. Jean-Noël AVILADec 31, 2021
  62. Junio C HamanoJan 3, 2022
  63. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  64. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Dec 29, 2021
  65. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Dec 29, 2021
  66. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Jan 2, 2022
  67. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  68. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  69. Johannes SixtJan 3, 2022
  70. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  71. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  72. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Jan 2, 2022
  73. René ScharfeJan 2, 2022
  74. Jean-Noël AVILAJan 2, 2022
  75. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Jan 2, 2022
  76. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  77. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Jan 2, 2022
  78. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  79. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Jan 2, 2022
  80. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Jan 2, 2022
  81. 00/11 Factorization of messages with similar meaningJean-Noël Avila via GitGitGadget, Jan 5, 2022
  82. 01/11 i18n: refactor "foo and bar are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  83. 02/11 i18n: refactor "%s, %s and %s are mutually exclusive"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  84. 04/11 i18n: standardize "cannot open" and "cannot read"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  85. 03/11 i18n: turn "options are incompatible" into "cannot be used together"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  86. 05/11 i18n: tag.c factorize i18n stringsJean-Noël Avila via GitGitGadget, Jan 5, 2022
  87. 07/11 i18n: factorize "no directory given for --foo"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  88. 06/11 i18n: factorize "--foo requires --bar" and the likeJean-Noël Avila via GitGitGadget, Jan 5, 2022
  89. 08/11 i18n: refactor "unrecognized %(foo) argument" stringsJean-Noël Avila via GitGitGadget, Jan 5, 2022
  90. 11/11 i18n: turn even more messages into "cannot be used together" onesJean-Noël Avila via GitGitGadget, Jan 5, 2022
  91. 09/11 i18n: factorize "--foo outside a repository"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  92. 10/11 i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom"Jean-Noël Avila via GitGitGadget, Jan 5, 2022
  93. Johannes SixtJan 5, 2022
  94. Junio C HamanoJan 5, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.