Re: [PATCH v9] ls-files: introduce "--format" option
From: Jiang Xin <hidden>
Date: 2022-09-08 02:01:24
On Sat, Jul 23, 2022 at 2:54 PM ZheNing Hu via GitGitGadget [off-list ref] wrote:
quoted hunk ↗ jump to hunk
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.
+ "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