Thread (35 messages) 35 messages, 7 authors, 2022-09-11

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

From: ZheNing Hu <hidden>
Date: 2022-09-11 11:01:20

Jiang Xin [off-list ref] 于2022年9月8日周四 10:01写道:
On Sat, Jul 23, 2022 at 2:54 PM ZheNing Hu via GitGitGadget
[off-list ref] wrote:
quoted
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.
quoted
+                     "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:
Thank you for pointing out the error, I will fix it quickly.
    https://github.com/git-l10n/pot-changes/blob/pot/main/2022-08-03.diff#L70

--
Jiang Xin
Thanks,
ZheNing Hu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help