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

Re: [PATCH v9] ls-files: introduce "--format" option

From
Jiang Xin <worldhello.net@gmail.com>
Date
Sep 8, 2022, 02:01 UTC
Message-ID
<CANYiYbFGSfg+iFV1ovhCSxW0YQSpemKUN-sS+F0BHee7KD5arA@mail.gmail.com>
In-Reply-To
<pull.1262.v9.git.1658558685407.gitgitgadget@gmail.com>

On Sat, Jul 23, 2022 at 2:54 PM ZheNing Hu via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 27 quoted lines
> diff --git a/builtin/ls-files.c b/builtin/ls-files.c
> index e791b65e7e9..779dc18e59d 100644
> --- a/builtin/ls-files.c
> +++ b/builtin/ls-files.c
> @@ -222,6 +234,73 @@ static void show_submodule(struct repository *superproject,
>         repo_clear(&subrepo);
>  }
>
> +struct show_index_data {
> +       const char *pathname;
> +       struct index_state *istate;
> +       const struct cache_entry *ce;
> +};
> +
> +static size_t expand_show_index(struct strbuf *sb, const char *start,
> +                               void *context)
> +{
> +       struct show_index_data *data = context;
> +       const char *end;
> +       const char *p;
> +       size_t len = strbuf_expand_literal_cb(sb, start, NULL);
> +       struct stat st;
> +
> +       if (len)
> +               return len;
> +       if (*start != '(')
> +               die(_("bad ls-files format: element '%s' "
Good, the last space acts as a separator between two lines.
Show 5 quoted lines
> +                     "does not start with '('"), start);
> +
> +       end = strchr(start + 1, ')');
> +       if (!end)
> +               die(_("bad ls-files format: element '%s'"

Missing the last space to seperate two lines, and this leads to wrong l10n message. See:

    https://github.com/git-l10n/pot-changes/blob/pot/main/2022-08-03.diff#L70

-- Jiang Xin

Previous: ZheNing Hu via GitGitGadgetNext: ZheNing Hu
Message 60 of 61 in “ls-files: introduce "--format" and "--object-only" options”
  1. 0/2 ls-files: introduce "--format" and "--object-only" optionsZheNing Hu via GitGitGadget, Jun 15, 2022
  2. 1/2 ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jun 15, 2022
  3. Ævar Arnfjörð BjarmasonJun 15, 2022
  4. ZheNing HuJun 18, 2022
  5. 2/2 ls-files: introduce "--object-only" optionZheNing Hu via GitGitGadget, Jun 15, 2022
  6. Ævar Arnfjörð BjarmasonJun 15, 2022
  7. ZheNing HuJun 18, 2022
  8. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jun 19, 2022
  9. Phillip WoodJun 19, 2022
  10. ZheNing HuJun 20, 2022
  11. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jun 21, 2022
  12. Phillip WoodJun 23, 2022
  13. Junio C HamanoJun 23, 2022
  14. Phillip WoodJun 24, 2022
  15. ZheNing HuJun 26, 2022
  16. Ævar Arnfjörð BjarmasonJun 24, 2022
  17. Junio C HamanoJun 24, 2022
  18. ZheNing HuJun 26, 2022
  19. Ævar Arnfjörð BjarmasonJun 24, 2022
  20. Junio C HamanoJun 24, 2022
  21. ZheNing HuJun 26, 2022
  22. Junio C HamanoJun 27, 2022
  23. ZheNing HuJun 27, 2022
  24. Junio C HamanoJun 27, 2022
  25. ZheNing HuJul 1, 2022
  26. ZheNing HuJun 26, 2022
  27. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jun 26, 2022
  28. Junio C HamanoJun 27, 2022
  29. ZheNing HuJun 27, 2022
  30. Ævar Arnfjörð BjarmasonJun 27, 2022
  31. ZheNing HuJul 1, 2022
  32. Phillip WoodJun 28, 2022
  33. ZheNing HuJul 1, 2022
  34. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jul 5, 2022
  35. Ævar Arnfjörð BjarmasonJul 5, 2022
  36. ZheNing HuJul 11, 2022
  37. Torsten BögershausenJul 5, 2022
  38. ZheNing HuJul 11, 2022
  39. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jul 11, 2022
  40. Junio C HamanoJul 11, 2022
  41. ZheNing HuJul 12, 2022
  42. Junio C HamanoJul 12, 2022
  43. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jul 13, 2022
  44. Ævar Arnfjörð BjarmasonJul 18, 2022
  45. ZheNing HuJul 19, 2022
  46. Junio C HamanoJul 19, 2022
  47. ZheNing HuJul 19, 2022
  48. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jul 20, 2022
  49. Junio C HamanoJul 20, 2022
  50. Ævar Arnfjörð BjarmasonJul 21, 2022
  51. Eric SunshineJul 21, 2022
  52. Junio C HamanoJul 21, 2022
  53. ZheNing HuJul 22, 2022
  54. Junio C HamanoJul 23, 2022
  55. Junio C HamanoJul 23, 2022
  56. ZheNing HuJul 24, 2022
  57. Junio C HamanoJul 25, 2022
  58. ZheNing HuJul 25, 2022
  59. ls-files: introduce "--format" optionZheNing Hu via GitGitGadget, Jul 23, 2022
  60. Jiang XinSep 8, 2022
  61. ZheNing HuSep 11, 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.