git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Teng Long <dyroneteng@gmail.com>
To: dyroneteng@gmail.com
Cc: Johannes.Schindelin@gmx.de, avarab@gmail.com,
	congdanhqx@gmail.com, git@vger.kernel.org, gitster@pobox.com,
	martin.agren@gmail.com, peff@peff.net,
	tenglong.tl@alibaba-inc.com
Subject: [PATCH v11 11/13] ls-tree.c: introduce "--format" option
Date: Tue,  8 Feb 2022 20:14:36 +0800	[thread overview]
Message-ID: <5936004f1386388740ded0208ebeb8c5d0c88ef2.1644319434.git.dyroneteng@gmail.com> (raw)
In-Reply-To: <cover.1644319434.git.dyroneteng@gmail.com>

From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

Add a --format option to ls-tree. It has an existing default output,
and then --long and --name-only options to emit the default output
along with the objectsize and, or to only emit object paths.

Rather than add --type-only, --object-only etc. we can just support a
--format using a strbuf_expand() similar to "for-each-ref
--format". We might still add such options in the future for
convenience.

The --format implementation is slower than the existing code, but this
change does not cause any performance regressions. We'll leave the
existing show_tree() unchanged, and only run show_tree_fmt() in if
a --format different than the hardcoded built-in ones corresponding to
the existing modes is provided.

I.e. something like the "--long" output would be much slower with
this, mainly due to how we need to allocate various things to do with
quote.c instead of spewing the output directly to stdout.

The new option of '--format' comes from Ævar Arnfjörð Bjarmasonn's
idea and suggestion, this commit makes modifications in terms of the
original discussion on community [1].

Here is the statistics about performance tests:

1. Default format (hitten the builtin formats):

    "git ls-tree <tree-ish>" vs "--format='%(mode) %(type) %(object)%x09%(file)'"

    $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r HEAD"
    Benchmark 1: /opt/git/master/bin/git ls-tree -r HEAD
    Time (mean ± σ):     105.2 ms ±   3.3 ms    [User: 84.3 ms, System: 20.8 ms]
    Range (min … max):    99.2 ms … 113.2 ms    28 runs

    $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object)%x09%(file)'  HEAD"
    Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object)%x09%(file)'  HEAD
    Time (mean ± σ):     106.4 ms ±   2.7 ms    [User: 86.1 ms, System: 20.2 ms]
    Range (min … max):   100.2 ms … 110.5 ms    29 runs

2. Default format includes object size (hitten the builtin formats):

    "git ls-tree -l <tree-ish>" vs "--format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'"

    $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r -l HEAD"
    Benchmark 1: /opt/git/master/bin/git ls-tree -r -l HEAD
    Time (mean ± σ):     335.1 ms ±   6.5 ms    [User: 304.6 ms, System: 30.4 ms]
    Range (min … max):   327.5 ms … 348.4 ms    10 runs

    $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'  HEAD"
    Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'  HEAD
    Time (mean ± σ):     337.2 ms ±   8.2 ms    [User: 309.2 ms, System: 27.9 ms]
    Range (min … max):   328.8 ms … 349.4 ms    10 runs

Links:
	[1] https://public-inbox.org/git/RFC-patch-6.7-eac299f06ff-20211217T131635Z-avarab@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
---
 Documentation/git-ls-tree.txt |  59 ++++++++++++++--
 builtin/ls-tree.c             | 129 +++++++++++++++++++++++++++++++++-
 t/t3104-ls-tree-format.sh     |  81 +++++++++++++++++++++
 3 files changed, 262 insertions(+), 7 deletions(-)
 create mode 100755 t/t3104-ls-tree-format.sh

diff --git a/Documentation/git-ls-tree.txt b/Documentation/git-ls-tree.txt
index db02d6d79a..db29a9efb5 100644
--- a/Documentation/git-ls-tree.txt
+++ b/Documentation/git-ls-tree.txt
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git ls-tree' [-d] [-r] [-t] [-l] [-z]
-	    [--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev[=<n>]]
+	    [--name-only] [--name-status] [--full-name] [--full-tree] [--abbrev[=<n>]] [--format=<format>]
 	    <tree-ish> [<path>...]
 
 DESCRIPTION
@@ -74,6 +74,16 @@ OPTIONS
 	Do not limit the listing to the current working directory.
 	Implies --full-name.
 
+--format=<format>::
+	A string that interpolates `%(fieldname)` from the result
+	being shown. It also interpolates `%%` to `%`, and
+	`%xx` where `xx` are hex digits interpolates to character
+	with hex code `xx`; for example `%00` interpolates to
+	`\0` (NUL), `%09` to `\t` (TAB) and `%0a` to `\n` (LF).
+	When specified, `--format` cannot be combined with other
+	format-altering options, including `--long`, `--name-only`
+	and `--object-only`.
+
 [<path>...]::
 	When paths are given, show them (note that this isn't really raw
 	pathnames, but rather a list of patterns to match).  Otherwise
@@ -82,16 +92,29 @@ OPTIONS
 
 Output Format
 -------------
-        <mode> SP <type> SP <object> TAB <file>
+
+The output format of `ls-tree` is determined by either the `--format`
+option, or other format-altering options such as `--name-only` etc.
+(see `--format` above).
+
+The use of certain `--format` directives is equivalent to using those
+options, but invoking the full formatting machinery can be slower than
+using an appropriate formatting option.
+
+In cases where the `--format` would exactly map to an existing option
+`ls-tree` will use the appropriate faster path. Thus the default format
+is equivalent to:
+
+        %(objectmode) %(objecttype) %(objectname)%x09%(path)
 
 This output format is compatible with what `--index-info --stdin` of
 'git update-index' expects.
 
 When the `-l` option is used, format changes to
 
-        <mode> SP <type> SP <object> SP <object size> TAB <file>
+        %(objectmode) %(objecttype) %(objectname) %(objectsize:padded)%x09%(path)
 
-Object size identified by <object> is given in bytes, and right-justified
+Object size identified by <objectname> is given in bytes, and right-justified
 with minimum width of 7 characters.  Object size is given only for blobs
 (file) entries; for other entries `-` character is used in place of size.
 
@@ -100,6 +123,34 @@ quoted as explained for the configuration variable `core.quotePath`
 (see linkgit:git-config[1]).  Using `-z` the filename is output
 verbatim and the line is terminated by a NUL byte.
 
+Customized format:
+
+It is possible to print in a custom format by using the `--format` option,
+which is able to interpolate different fields using a `%(fieldname)` notation.
+For example, if you only care about the "objectname" and "path" fields, you
+can execute with a specific "--format" like
+
+        git ls-tree --format='%(objectname) %(path)' <tree-ish>
+
+FIELD NAMES
+-----------
+
+Various values from structured fields can be used to interpolate
+into the resulting output. For each outputing line, the following
+names can be used:
+
+objectmode::
+	The mode of the object.
+objecttype::
+	The type of the object (`blob` or `tree`).
+objectname::
+	The name of the object.
+objectsize[:padded]::
+	The size of the object ("-" if it's a tree).
+	It also supports a padded format of size with "%(size:padded)".
+path::
+	The pathname of the object.
+
 GIT
 ---
 Part of the linkgit:git[1] suite
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 293b8f9dfb..1c71e5d543 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -33,7 +33,10 @@ static unsigned int shown_fields;
 #define FIELD_MODE (1 << 4)
 #define FIELD_DEFAULT 29 /* 11101 size is not shown to output by default */
 #define FIELD_LONG_DEFAULT  (FIELD_DEFAULT | FIELD_SIZE)
-
+static const char *format;
+static const char *default_format = "%(objectmode) %(objecttype) %(objectname)%x09%(path)";
+static const char *long_format = "%(objectmode) %(objecttype) %(objectname) %(objectsize:padded)%x09%(path)";
+static const char *name_only_format = "%(path)";
 struct show_tree_data {
 	unsigned mode;
 	enum object_type type;
@@ -55,6 +58,72 @@ enum {
 
 static int cmdmode = MODE_UNSPECIFIED;
 
+static void expand_objectsize(struct strbuf *line, const struct object_id *oid,
+			      const enum object_type type, unsigned int padded)
+{
+	if (type == OBJ_BLOB) {
+		unsigned long size;
+		if (oid_object_info(the_repository, oid, &size) < 0)
+			die(_("could not get object info about '%s'"),
+			    oid_to_hex(oid));
+		if (padded)
+			strbuf_addf(line, "%7"PRIuMAX, (uintmax_t)size);
+		else
+			strbuf_addf(line, "%"PRIuMAX, (uintmax_t)size);
+	} else if (padded) {
+		strbuf_addf(line, "%7s", "-");
+	} else {
+		strbuf_addstr(line, "-");
+	}
+}
+
+static size_t expand_show_tree(struct strbuf *sb, const char *start,
+			       void *context)
+{
+	struct show_tree_data *data = context;
+	const char *end;
+	const char *p;
+	unsigned int errlen;
+	size_t len = strbuf_expand_literal_cb(sb, start, NULL);
+
+	if (len)
+		return len;
+	if (*start != '(')
+		die(_("bad ls-tree format: as '%s'"), start);
+
+	end = strchr(start + 1, ')');
+	if (!end)
+		die(_("bad ls-tree format: element '%s' does not end in ')'"), start);
+
+	len = end - start + 1;
+	if (skip_prefix(start, "(objectmode)", &p)) {
+		strbuf_addf(sb, "%06o", data->mode);
+	} else if (skip_prefix(start, "(objecttype)", &p)) {
+		strbuf_addstr(sb, type_name(data->type));
+	} else if (skip_prefix(start, "(objectsize:padded)", &p)) {
+		expand_objectsize(sb, data->oid, data->type, 1);
+	} else if (skip_prefix(start, "(objectsize)", &p)) {
+		expand_objectsize(sb, data->oid, data->type, 0);
+	} else if (skip_prefix(start, "(objectname)", &p)) {
+		strbuf_add_unique_abbrev(sb, data->oid, abbrev);
+	} else if (skip_prefix(start, "(path)", &p)) {
+		const char *name = data->base->buf;
+		const char *prefix = chomp_prefix ? ls_tree_prefix : NULL;
+		struct strbuf quoted = STRBUF_INIT;
+		struct strbuf sbuf = STRBUF_INIT;
+		strbuf_addstr(data->base, data->pathname);
+		name = relative_path(data->base->buf, prefix, &sbuf);
+		quote_c_style(name, &quoted, NULL, 0);
+		strbuf_addbuf(sb, &quoted);
+		strbuf_release(&sbuf);
+		strbuf_release(&quoted);
+	} else {
+		errlen = (unsigned long)len;
+		die(_("bad ls-tree format: %%%.*s"), errlen, start);
+	}
+	return len;
+}
+
 static int parse_shown_fields(void)
 {
 	if (cmdmode == MODE_NAME_ONLY) {
@@ -101,6 +170,38 @@ static int show_recursive(const char *base, size_t baselen, const char *pathname
 	return 0;
 }
 
+static int show_tree_fmt(const struct object_id *oid, struct strbuf *base,
+			 const char *pathname, unsigned mode, void *context)
+{
+	size_t baselen;
+	int recurse = 0;
+	struct strbuf sb = STRBUF_INIT;
+	enum object_type type = object_type(mode);
+
+	struct show_tree_data data = {
+		.mode = mode,
+		.type = type,
+		.oid = oid,
+		.pathname = pathname,
+		.base = base,
+	};
+
+	if (type == OBJ_TREE && show_recursive(base->buf, base->len, pathname))
+		recurse = READ_TREE_RECURSIVE;
+	if (type == OBJ_TREE && recurse && !(ls_options & LS_SHOW_TREES))
+		return recurse;
+	if (type == OBJ_BLOB && (ls_options & LS_TREE_ONLY))
+		return 0;
+
+	baselen = base->len;
+	strbuf_expand(&sb, format, expand_show_tree, &data);
+	strbuf_addch(&sb, line_termination);
+	fwrite(sb.buf, sb.len, 1, stdout);
+	strbuf_release(&sb);
+	strbuf_setlen(base, baselen);
+	return recurse;
+}
+
 static int show_default(struct show_tree_data *data)
 {
 	size_t baselen = data->base->len;
@@ -174,6 +275,7 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
 	struct object_id oid;
 	struct tree *tree;
 	int i, full_tree = 0;
+	read_tree_fn_t fn = show_tree;
 	const struct option ls_tree_options[] = {
 		OPT_BIT('d', NULL, &ls_options, N_("only show trees"),
 			LS_TREE_ONLY),
@@ -194,6 +296,9 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
 		OPT_BOOL(0, "full-tree", &full_tree,
 			 N_("list entire tree; not just current directory "
 			    "(implies --full-name)")),
+		OPT_STRING_F(0, "format", &format, N_("format"),
+					 N_("format to use for the output"),
+					 PARSE_OPT_NONEG),
 		OPT__ABBREV(&abbrev),
 		OPT_END()
 	};
@@ -214,6 +319,10 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
 	    ((LS_TREE_ONLY|LS_RECURSIVE) & ls_options))
 		ls_options |= LS_SHOW_TREES;
 
+	if (format && cmdmode)
+		usage_msg_opt(
+			_("--format can't be combined with other format-altering options"),
+			ls_tree_usage, ls_tree_options);
 	if (argc < 1)
 		usage_with_options(ls_tree_usage, ls_tree_options);
 	if (get_oid(argv[0], &oid))
@@ -237,6 +346,20 @@ int cmd_ls_tree(int argc, const char **argv, const char *prefix)
 	tree = parse_tree_indirect(&oid);
 	if (!tree)
 		die("not a tree object");
-	return !!read_tree(the_repository, tree,
-			   &pathspec, show_tree, NULL);
+	/*
+	 * The generic show_tree_fmt() is slower than show_tree(), so
+	 * take the fast path if possible.
+	 */
+	if (format && (!strcmp(format, default_format))) {
+		fn = show_tree;
+	} else if (format && (!strcmp(format, long_format))) {
+		shown_fields = shown_fields | FIELD_SIZE;
+		fn = show_tree;
+	} else if (format && (!strcmp(format, name_only_format))) {
+		shown_fields = FIELD_PATH_NAME;
+		fn = show_tree;
+	} else if (format)
+		fn = show_tree_fmt;
+
+	return !!read_tree(the_repository, tree, &pathspec, fn, NULL);
 }
diff --git a/t/t3104-ls-tree-format.sh b/t/t3104-ls-tree-format.sh
new file mode 100755
index 0000000000..e08c83dc47
--- /dev/null
+++ b/t/t3104-ls-tree-format.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+test_description='ls-tree --format'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success 'ls-tree --format usage' '
+	test_expect_code 129 git ls-tree --format=fmt -l HEAD &&
+	test_expect_code 129 git ls-tree --format=fmt --name-only HEAD &&
+	test_expect_code 129 git ls-tree --format=fmt --name-status HEAD
+'
+
+test_expect_success 'setup' '
+	mkdir dir &&
+	test_commit dir/sub-file &&
+	test_commit top-file
+'
+
+test_ls_tree_format () {
+	format=$1 &&
+	opts=$2 &&
+	fmtopts=$3 &&
+	shift 2 &&
+	git ls-tree $opts -r HEAD >expect.raw &&
+	sed "s/^/> /" >expect <expect.raw &&
+	git ls-tree --format="> $format" -r $fmtopts HEAD >actual &&
+	test_cmp expect actual
+}
+
+test_expect_success 'ls-tree --format=<default-like>' '
+	test_ls_tree_format \
+		"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
+		""
+'
+
+test_expect_success 'ls-tree --format=<long-like>' '
+	test_ls_tree_format \
+		"%(objectmode) %(objecttype) %(objectname) %(objectsize:padded)%x09%(path)" \
+		"--long"
+'
+
+test_expect_success 'ls-tree --format=<name-only-like>' '
+	test_ls_tree_format \
+		"%(path)" \
+		"--name-only"
+'
+
+test_expect_success 'ls-tree combine --format=<default-like> and -t' '
+	test_ls_tree_format \
+	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
+	"-t" \
+	"-t"
+'
+
+test_expect_success 'ls-tree combine --format=<default-like> and --full-name' '
+	test_ls_tree_format \
+	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
+	"--full-name" \
+	"--full-name"
+'
+
+test_expect_success 'ls-tree combine --format=<default-like> and --full-tree' '
+	test_ls_tree_format \
+	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
+	"--full-tree" \
+	"--full-tree"
+'
+
+test_expect_success 'ls-tree hit fast-path with --format=<default-like>' '
+	git ls-tree -r HEAD >expect &&
+	git ls-tree --format="%(objectmode) %(objecttype) %(objectname)%x09%(path)" -r HEAD >actual &&
+	test_cmp expect actual
+'
+
+test_expect_success 'ls-tree hit fast-path with --format=<name-only-like>' '
+	git ls-tree -r --name-only HEAD >expect &&
+	git ls-tree --format="%(path)" -r HEAD >actual &&
+	test_cmp expect actual
+'
+test_done
-- 
2.34.1.403.gb35f2687cf.dirty


  parent reply	other threads:[~2022-02-08 13:15 UTC|newest]

Thread overview: 236+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 11:51 [PATCH 0/3] support `--oid-only` in `ls-tree` Teng Long
2021-11-15 11:51 ` [PATCH 1/3] ls-tree.c: support `--oid-only` option for "git-ls-tree" Teng Long
2021-11-15 15:12   ` Ævar Arnfjörð Bjarmason
2021-11-18  9:28     ` Teng Long
2021-11-18 11:00       ` Ævar Arnfjörð Bjarmason
2021-11-15 19:16   ` Jeff King
2021-11-15 19:25     ` Jeff King
2021-11-18 11:23     ` Teng Long
2021-11-15 11:51 ` [PATCH 2/3] t3104: add related tests for `--oid-only` option Teng Long
2021-11-15 15:54   ` Đoàn Trần Công Danh
2021-11-18  8:45     ` Teng Long
2021-11-15 11:51 ` [PATCH 3/3] git-ls-tree.txt: description of the 'oid-only' option Teng Long
2021-11-15 15:13 ` [PATCH 0/3] support `--oid-only` in `ls-tree` Ævar Arnfjörð Bjarmason
2021-11-15 19:09   ` Jeff King
2021-11-15 21:50     ` Ævar Arnfjörð Bjarmason
2021-11-19  2:57       ` Teng Long
2021-11-15 19:23 ` Jeff King
2021-11-19 12:09 ` [PATCH v2 0/1] " Teng Long
2021-11-19 12:09   ` [PATCH v2 1/1] ls-tree.c: support `--oid-only` option for "git-ls-tree" Teng Long
2021-11-19 13:30     ` Ævar Arnfjörð Bjarmason
2021-11-19 17:32       ` Junio C Hamano
2021-11-22  7:45       ` Teng Long
2021-11-22 11:14         ` Ævar Arnfjörð Bjarmason
2021-11-22  8:07   ` [PATCH v3 0/1] ls-tree.c: support `--oid-only` option Teng Long
2021-11-22  8:07     ` [PATCH v3 1/1] ls-tree.c: support `--oid-only` option for "git-ls-tree" Teng Long
2021-11-22 18:11       ` Peter Baumann
2021-11-22 18:54       ` Junio C Hamano
2021-11-23  1:09         ` Ævar Arnfjörð Bjarmason
2021-11-23  1:26           ` Junio C Hamano
2021-11-23  2:28             ` Ævar Arnfjörð Bjarmason
2021-11-23  2:55               ` Junio C Hamano
2021-11-23  3:35                 ` Junio C Hamano
2021-11-23 11:04                   ` Ævar Arnfjörð Bjarmason
2021-11-23  0:14       ` Đoàn Trần Công Danh
2021-11-23  4:58     ` [PATCH v4 0/1] ls-tree.c: support `--oid-only` option Teng Long
2021-11-23  4:58       ` [PATCH v4 1/1] ls-tree.c: support `--oid-only` option for "git-ls-tree" Teng Long
2021-11-23 22:32         ` Junio C Hamano
2021-12-06  7:52           ` Teng Long
2021-12-08  2:08       ` [PATCH v5 0/1] support `--object-only` " Teng Long
2021-12-08  2:08         ` [PATCH v5 1/1] ls-tree.c: " Teng Long
2021-12-15 19:25           ` Junio C Hamano
2021-12-16 12:16             ` Teng Long
2021-12-16 21:26               ` Junio C Hamano
2021-12-16 21:29                 ` Ævar Arnfjörð Bjarmason
2021-12-17  6:57         ` [PATCH v6 0/1] " Teng Long
2021-12-17  6:57           ` [PATCH v6 1/1] ls-tree.c: " Teng Long
2021-12-17 13:09             ` Ævar Arnfjörð Bjarmason
2021-12-17 13:30           ` [RFC PATCH 0/7] ls-tree --format Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 1/7] ls-tree: remove commented-out code Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 2/7] ls-tree: add missing braces to "else" arms Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 3/7] ls-tree: use "enum object_type", not {blob,tree,commit}_type Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 4/7] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 5/7] ls-tree: split up the "init" part of show_tree() Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 6/7] ls-tree: add a --format=<fmt> option Ævar Arnfjörð Bjarmason
2021-12-17 13:30             ` [RFC PATCH 7/7] ls-tree.c: support `--object-only` option for "git-ls-tree" Ævar Arnfjörð Bjarmason
2022-01-01 13:50           ` [PATCH v8 0/8] ls-tree: "--object-only" and "--format" opts Teng Long
2022-01-01 13:50             ` [PATCH v8 1/8] ls-tree: remove commented-out code Teng Long
2022-01-01 13:50             ` [PATCH v8 2/8] ls-tree: add missing braces to "else" arms Teng Long
2022-01-01 13:50             ` [PATCH v8 3/8] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-01-01 13:50             ` [PATCH v8 4/8] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-01-01 13:50             ` [PATCH v8 5/8] ls-tree: split up the "init" part of show_tree() Teng Long
2022-01-04  2:06               ` Junio C Hamano
2022-01-04  9:49                 ` Teng Long
2022-01-01 13:50             ` [PATCH v8 6/8] ls-tree.c: support --object-only option for "git-ls-tree" Teng Long
2022-01-04  1:21               ` Junio C Hamano
2022-01-04  7:29                 ` Teng Long
2022-01-01 13:50             ` [PATCH v8 7/8] ls-tree.c: introduce struct "shown_data" Teng Long
2022-01-03 23:21               ` Junio C Hamano
2022-01-04  2:02                 ` Teng Long
2022-01-01 13:50             ` [PATCH v8 8/8] ls-tree.c: introduce "--format" option Teng Long
2022-01-04 14:38               ` Johannes Schindelin
2022-01-04 15:17                 ` Johannes Schindelin
2022-01-05  9:40                   ` Teng Long
2022-01-05  9:58                 ` Teng Long
2022-01-05 13:09                   ` Johannes Schindelin
2022-01-05 16:44                     ` Teng Long
2022-01-06  4:31             ` [PATCH v9 0/9] " Teng Long
2022-01-06  4:31               ` [PATCH v9 1/9] ls-tree: remove commented-out code Teng Long
2022-01-06  4:31               ` [PATCH v9 2/9] ls-tree: add missing braces to "else" arms Teng Long
2022-01-06  4:31               ` [PATCH v9 3/9] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-01-06  4:31               ` [PATCH v9 4/9] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-01-06  4:31               ` [PATCH v9 5/9] ls-tree: optimize naming and handling of "return" in show_tree() Teng Long
2022-01-06 20:44                 ` Junio C Hamano
2022-01-11  9:14                   ` Teng Long
2022-01-06  4:31               ` [PATCH v9 6/9] ls-tree.c: support --object-only option for "git-ls-tree" Teng Long
2022-01-06  4:31               ` [PATCH v9 7/9] ls-tree.c: introduce struct "show_tree_data" Teng Long
2022-01-06  4:31               ` [PATCH v9 8/9] ls-tree.c: introduce "--format" option Teng Long
2022-01-10 19:41                 ` Martin Ågren
2022-01-11  9:34                   ` Teng Long
2022-01-06  4:31               ` [PATCH v9 9/9] cocci: allow padding with `strbuf_addf()` Teng Long
2022-01-07 13:03                 ` Johannes Schindelin
2022-01-10  8:22                   ` Teng Long
2022-01-10 12:49                     ` Johannes Schindelin
2022-01-10 14:40                       ` Teng Long
2022-01-10 17:47                       ` Junio C Hamano
2022-01-10 18:02                       ` Ævar Arnfjörð Bjarmason
2022-01-10 18:34                   ` Junio C Hamano
2022-01-10 18:00                 ` Ævar Arnfjörð Bjarmason
2022-01-11 10:37                   ` Teng Long
2022-01-11 16:42                   ` Taylor Blau
2022-01-11 19:06                     ` René Scharfe
2022-01-11 20:11                       ` Taylor Blau
2022-01-13  3:34                         ` Teng Long
2022-01-11 20:39                     ` Ævar Arnfjörð Bjarmason
2022-01-13  3:35                       ` Teng Long
2022-01-13  3:28                     ` Teng Long
2022-01-13  3:42               ` [PATCH v10 0/9] ls-tree: "--object-only" and "--format" opts Teng Long
2022-01-13  3:42                 ` [PATCH v10 1/9] ls-tree: remove commented-out code Teng Long
2022-01-13  3:42                 ` [PATCH v10 2/9] ls-tree: add missing braces to "else" arms Teng Long
2022-01-13  3:42                 ` [PATCH v10 3/9] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-01-13  3:42                 ` [PATCH v10 4/9] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-01-13  3:42                 ` [PATCH v10 5/9] ls-tree: optimize naming and handling of "return" in show_tree() Teng Long
2022-01-13  6:49                   ` Ævar Arnfjörð Bjarmason
2022-01-14  7:59                     ` Teng Long
2022-01-14 12:00                       ` Ævar Arnfjörð Bjarmason
2022-01-13  3:42                 ` [PATCH v10 6/9] ls-tree.c: support --object-only option for "git-ls-tree" Teng Long
2022-01-13  6:59                   ` Ævar Arnfjörð Bjarmason
2022-01-14  8:18                     ` Teng Long
2022-01-14 11:47                       ` Ævar Arnfjörð Bjarmason
2022-01-18  9:55                         ` Teng Long
2022-02-04 12:58                           ` Ævar Arnfjörð Bjarmason
2022-02-07  2:22                             ` Teng Long
2022-01-13  3:42                 ` [PATCH v10 7/9] ls-tree.c: introduce struct "show_tree_data" Teng Long
2022-01-13  7:03                   ` Ævar Arnfjörð Bjarmason
2022-01-14  9:12                     ` Teng Long
2022-01-13  3:42                 ` [PATCH v10 8/9] cocci: allow padding with `strbuf_addf()` Teng Long
2022-01-13  3:42                 ` [PATCH v10 9/9] ls-tree.c: introduce "--format" option Teng Long
2022-01-13  7:16                   ` Ævar Arnfjörð Bjarmason
2022-01-18 12:59                     ` Teng Long
2022-02-08 12:14                 ` [PATCH v11 00/13] ls-tree: "--object-only" and "--format" opts Teng Long
2022-02-08 12:14                   ` [PATCH v11 01/13] ls-tree: remove commented-out code Teng Long
2022-02-08 12:14                   ` [PATCH v11 02/13] ls-tree: add missing braces to "else" arms Teng Long
2022-02-08 12:14                   ` [PATCH v11 03/13] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-02-08 12:14                   ` [PATCH v11 04/13] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-02-08 12:14                   ` [PATCH v11 05/13] ls-tree: rename "retval" to "recurse" in "show_tree()" Teng Long
2022-02-08 12:14                   ` [PATCH v11 06/13] ls-tree: simplify nesting if/else logic " Teng Long
2022-02-19  6:06                     ` Ævar Arnfjörð Bjarmason
2022-02-08 12:14                   ` [PATCH v11 07/13] ls-tree: fix "--name-only" and "--long" combined use bug Teng Long
2022-02-19  6:04                     ` Ævar Arnfjörð Bjarmason
2022-02-08 12:14                   ` [PATCH v11 08/13] ls-tree: slightly refactor `show_tree()` Teng Long
2022-02-19  5:56                     ` Ævar Arnfjörð Bjarmason
     [not found]                       ` <CADMgQSRYKB1ybxZWxQQ3uVM71fmdbzHqcK-WUPNKm2HMxw2C2g@mail.gmail.com>
2022-02-28 16:18                         ` Ævar Arnfjörð Bjarmason
2022-02-08 12:14                   ` [PATCH v11 09/13] ls-tree: introduce struct "show_tree_data" Teng Long
2022-02-08 12:14                   ` [PATCH v11 10/13] cocci: allow padding with `strbuf_addf()` Teng Long
2022-02-08 12:14                   ` Teng Long [this message]
2022-02-19  5:44                     ` [PATCH v11 11/13] ls-tree.c: introduce "--format" option Ævar Arnfjörð Bjarmason
2022-02-08 12:14                   ` [PATCH v11 12/13] ls-tree: introduce function "fast_path()" Teng Long
2022-02-19  5:32                     ` Ævar Arnfjörð Bjarmason
2022-02-08 12:14                   ` [PATCH v11 13/13] ls-tree.c: support --object-only option for "git-ls-tree" Teng Long
2022-02-19  5:24                     ` Ævar Arnfjörð Bjarmason
2022-03-04 10:42                   ` [PATCH v12 00/12] ls-tree: "--object-only" and "--format" opts Teng Long
2022-03-04 10:42                     ` [PATCH v12 01/12] ls-tree: remove commented-out code Teng Long
2022-03-04 10:42                     ` [PATCH v12 02/12] ls-tree: add missing braces to "else" arms Teng Long
2022-03-04 10:42                     ` [PATCH v12 03/12] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-03-04 10:42                     ` [PATCH v12 04/12] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-03-04 10:42                     ` [PATCH v12 05/12] ls-tree: rename "retval" to "recurse" in "show_tree()" Teng Long
2022-03-04 10:42                     ` [PATCH v12 06/12] ls-tree: simplify nesting if/else logic " Teng Long
2022-03-04 10:42                     ` [PATCH v12 07/12] ls-tree: fix "--name-only" and "--long" combined use bug Teng Long
2022-03-04 10:42                     ` [PATCH v12 08/12] ls-tree: slightly refactor `show_tree()` Teng Long
2022-03-04 10:42                     ` [PATCH v12 09/12] ls-tree: introduce struct "show_tree_data" Teng Long
2022-03-04 10:42                     ` [PATCH v12 10/12] cocci: allow padding with `strbuf_addf()` Teng Long
2022-03-04 10:42                     ` [PATCH v12 11/12] ls-tree: introduce "--format" option Teng Long
2022-03-04 10:42                     ` [PATCH v12 12/12] ls-tree: support --object-only option for "git-ls-tree" Teng Long
2022-03-10 13:56                     ` [RFC/REVIEW 0/7] fixups/suggestions/musings for tl/ls-tree-oid-only Ævar Arnfjörð Bjarmason
2022-03-10 13:56                       ` [RFC/REVIEW 1/7] ls-tree tests: add tests for --name-status Ævar Arnfjörð Bjarmason
2022-03-10 13:56                       ` [RFC/REVIEW 2/7] ls-tree tests: exhaustively test fast & slow path for --format Ævar Arnfjörð Bjarmason
2022-03-10 13:56                       ` [RFC/REVIEW 3/7] ls-tree: remove dead labels Ævar Arnfjörð Bjarmason
2022-03-10 13:57                       ` [RFC/REVIEW 4/7] ls-tree: remove unused "MODE_UNSPECIFIED" Ævar Arnfjörð Bjarmason
2022-03-10 13:57                       ` [RFC/REVIEW 5/7] ls-tree: detect and error on --name-only --name-status Ævar Arnfjörð Bjarmason
2022-03-10 13:57                       ` [RFC/REVIEW 6/7] ls-tree: remove FIELD_*, just use MODE_* Ævar Arnfjörð Bjarmason
2022-03-10 13:57                       ` [RFC/REVIEW 7/7] ls-tree: split up "fast path" callbacks Ævar Arnfjörð Bjarmason
2022-03-17  9:51                       ` [RFC/REVIEW 0/7] fixups/suggestions/musings for tl/ls-tree-oid-only Teng Long
2022-03-17 10:04                         ` Ævar Arnfjörð Bjarmason
2022-03-21  7:33                     ` [PATCH v13 00/16] ls-tree: "--object-only" and "--format" opts Teng Long
2022-03-21  7:33                       ` [PATCH v13 01/16] ls-tree: remove commented-out code Teng Long
2022-03-21  7:33                       ` [PATCH v13 02/16] ls-tree: add missing braces to "else" arms Teng Long
2022-03-21  7:33                       ` [PATCH v13 03/16] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-03-21  7:33                       ` [PATCH v13 04/16] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-03-21  7:33                       ` [PATCH v13 05/16] ls-tree: rename "retval" to "recurse" in "show_tree()" Teng Long
2022-03-21  7:33                       ` [PATCH v13 06/16] ls-tree: simplify nesting if/else logic " Teng Long
2022-03-21  7:33                       ` [PATCH v13 07/16] ls-tree: fix "--name-only" and "--long" combined use bug Teng Long
2022-03-21  7:33                       ` [PATCH v13 08/16] ls-tree: slightly refactor `show_tree()` Teng Long
2022-03-21  7:33                       ` [PATCH v13 09/16] ls-tree: introduce struct "show_tree_data" Teng Long
2022-03-21  7:33                       ` [PATCH v13 10/16] cocci: allow padding with `strbuf_addf()` Teng Long
2022-03-21  7:33                       ` [PATCH v13 11/16] ls-tree: introduce "--format" option Teng Long
2022-03-21  9:22                         ` Ævar Arnfjörð Bjarmason
2022-03-21  7:33                       ` [PATCH v13 12/16] ls-tree: support --object-only option for "git-ls-tree" Teng Long
2022-03-21  7:33                       ` [PATCH v13 13/16] ls-tree tests: add tests for --name-status Teng Long
2022-03-21  9:21                         ` Ævar Arnfjörð Bjarmason
2022-03-21  7:33                       ` [PATCH v13 14/16] ls-tree: detect and error on --name-only --name-status Teng Long
2022-03-21  7:33                       ` [PATCH v13 15/16] ls-tree: remove FIELD_*, just use MODE_* Teng Long
2022-03-21  9:15                         ` Ævar Arnfjörð Bjarmason
2022-03-21  7:33                       ` [PATCH v13 16/16] ls-tree: split up "fast path" callbacks Teng Long
2022-03-21  9:20                         ` Ævar Arnfjörð Bjarmason
2022-03-23  9:58                           ` Teng Long
2022-03-21 19:07                       ` [PATCH v13 00/16] ls-tree: "--object-only" and "--format" opts Junio C Hamano
2022-03-23  9:13                       ` [PATCH v14 00/15] " Teng Long
2022-03-23  9:13                         ` [PATCH v14 01/15] ls-tree tests: add tests for --name-status Teng Long
2022-03-23  9:13                         ` [PATCH v14 02/15] ls-tree: remove commented-out code Teng Long
2022-03-23  9:13                         ` [PATCH v14 03/15] ls-tree: add missing braces to "else" arms Teng Long
2022-03-23  9:13                         ` [PATCH v14 04/15] ls-tree: use "enum object_type", not {blob,tree,commit}_type Teng Long
2022-03-23  9:13                         ` [PATCH v14 05/15] ls-tree: use "size_t", not "int" for "struct strbuf"'s "len" Teng Long
2022-03-23  9:13                         ` [PATCH v14 06/15] ls-tree: rename "retval" to "recurse" in "show_tree()" Teng Long
2022-03-23  9:13                         ` [PATCH v14 07/15] ls-tree: simplify nesting if/else logic " Teng Long
2022-03-23  9:13                         ` [PATCH v14 08/15] ls-tree: fix "--name-only" and "--long" combined use bug Teng Long
2022-03-23  9:13                         ` [PATCH v14 09/15] ls-tree: slightly refactor `show_tree()` Teng Long
2022-03-23  9:13                         ` [PATCH v14 10/15] ls-tree: introduce struct "show_tree_data" Teng Long
2022-03-23  9:13                         ` [PATCH v14 11/15] cocci: allow padding with `strbuf_addf()` Teng Long
2022-03-23  9:13                         ` [PATCH v14 12/15] ls-tree: introduce "--format" option Teng Long
2022-03-23  9:13                         ` [PATCH v14 13/15] ls-tree: support --object-only option for "git-ls-tree" Teng Long
2022-03-23  9:13                         ` [PATCH v14 14/15] ls-tree: detect and error on --name-only --name-status Teng Long
2022-03-23  9:13                         ` [PATCH v14 15/15] ls-tree: split up "fast path" callbacks Teng Long
2022-04-04 20:06                           ` Josh Steadmon
2022-04-04 22:42                             ` [RFC PATCH] ls-tree: `-l` should not imply recursive listing Josh Steadmon
2022-04-04 23:45                               ` [PATCH v2] ls-tree: fix --long implying -r regression in 9c4d58ff2c3 Ævar Arnfjörð Bjarmason
2022-04-06 17:56                                 ` Junio C Hamano
2022-04-06 20:36                                   ` Ævar Arnfjörð Bjarmason
2022-04-06 21:51                                     ` Junio C Hamano
2022-04-07  7:14                                       ` Ævar Arnfjörð Bjarmason
2022-04-07 18:40                                         ` Junio C Hamano
2022-05-31 17:21                                           ` [PATCH] ls-tree: test for the " Ævar Arnfjörð Bjarmason
2022-06-02 15:18                                             ` Johannes Schindelin
2022-06-02 17:48                                               ` Junio C Hamano
2022-06-03  9:54                                               ` js/ci-github-workflow-markup output regression (was: [PATCH] ls-tree: test for the regression in 9c4d58ff2c3) Ævar Arnfjörð Bjarmason
2022-06-03 19:27                                                 ` js/ci-github-workflow-markup output regression Junio C Hamano
2022-06-03 23:13                                                   ` Ævar Arnfjörð Bjarmason
2022-06-07 18:25                                                     ` Junio C Hamano
2022-06-07 21:40                                                       ` Ævar Arnfjörð Bjarmason
2022-06-08  8:04                                                       ` Johannes Schindelin
2022-06-09 19:43                                                         ` Ævar Arnfjörð Bjarmason
2022-06-03 10:23                                             ` [PATCH v2] ls-tree: test for the regression in 9c4d58ff2c3 Ævar Arnfjörð Bjarmason
2022-06-08 21:55                                               ` Johannes Schindelin
2022-04-07  9:29                                 ` [PATCH v2] ls-tree: fix --long implying -r " Teng Long
2022-04-06 15:41                               ` [RFC PATCH] ls-tree: `-l` should not imply recursive listing Junio C Hamano
2022-03-23 19:54                         ` [PATCH v14 00/15] ls-tree: "--object-only" and "--format" opts Junio C Hamano
2022-03-24  3:00                           ` Teng Long

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=5936004f1386388740ded0208ebeb8c5d0c88ef2.1644319434.git.dyroneteng@gmail.com \
    --to=dyroneteng@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.agren@gmail.com \
    --cc=peff@peff.net \
    --cc=tenglong.tl@alibaba-inc.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).