All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Josh Steadmon <steadmon@google.com>,
	Johannes.Schindelin@gmx.de, avarab@gmail.com,
	congdanhqx@gmail.com, dyroneteng@gmail.com,
	martin.agren@gmail.com, peff@peff.net,
	tenglong.tl@alibaba-inc.com
Subject: [PATCH] ls-tree: test for the regression in 9c4d58ff2c3
Date: Tue, 31 May 2022 19:21:54 +0200	[thread overview]
Message-ID: <patch-1.1-0fdfec624eb-20220531T171908Z-avarab@gmail.com> (raw)
In-Reply-To: <xmqqee28spni.fsf@gitster.g>

Add a test for the regression introduced in my 9c4d58ff2c3 (ls-tree:
split up "fast path" callbacks, 2022-03-23) and fixed in
350296cc789 (ls-tree: `-l` should not imply recursive listing,
2022-04-04), and test for the test of ls-tree option/mode combinations
to make sure we don't have other blind spots.

The setup for these tests can be shared with those added in the
1041d58b4d9 (Merge branch 'tl/ls-tree-oid-only', 2022-04-04) topic, so
let's create a new t/lib-t3100.sh to help them share data.

The existing tests in "t3104-ls-tree-format.sh" didn't deal with a
submodule, which they'll now encounter with as the
setup_basic_ls_tree_data() sets one up.

This extensive testing should give us confidence that there were no
further regressions in this area. The lack of testing was noted back
in [1], but unfortunately we didn't cover that blind-spot before
9c4d58ff2c3.

1. https://lore.kernel.org/git/211115.86o86lqe3c.gmgdl@evledraar.gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

On Thu, Apr 07 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>>>>> Let's not go too cute like this.  This forces the caller to remember
>>>>> which among 6, 7, and 8 corresponds to which option.  It is too ugly
>>>>> to live.
>>>>
>>>> I think it's rather elegant actually, but to be fair it would, per:
>>>>
>>>>    git grep '<&[1-9]| [1-9]<<-'
>>>>
>>>> Be the user with the most FD's using this sort of pattern.
>>>
>>> Please give a clear explanation why "-d" has to be 6, "-r" 7 and
>>> "-t" 8, that can be used by developers as a memory aid to help them
>>> write new tests using the helper.
>>
>> It's documented when test-lib.sh does the redirection, since Fabian
>> Stelzer's a6714088e0c (test-lib: make BAIL_OUT() work in tests and
>> prereq, 2021-12-01).
>
> Sorry, but that is not what I asked.  I know what we use lower file
> descriptors for, and I didn't ask why we start from 6 (as opposed to
> 3).
>
> The updated helper forces our developers to know that the expected
> result for "-d" has to go to #6 (not #7 or #8), and "-r" to #7 (not
> #6 or #8), etc., in order to write new tests using it, and in order
> to spot a mistake while reviewing such new tests.
>
> It is an invitation to unmaintainable mess.  Don't encourage it.

I came up with this at the time, but didn't submit it since we were in
the rc period.

But since we're past that I think it makes sense to have a test for
the regression we fixed, the below is a lot less magical, but larger
by line count. I think this alternate test implementation should
address the concerns you had.

Range-diff:
1:  ed83b3b74ab ! 1:  0fdfec624eb ls-tree: fix --long implying -r regression in 9c4d58ff2c3
    @@ Metadata
     Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
      ## Commit message ##
    -    ls-tree: fix --long implying -r regression in 9c4d58ff2c3
    +    ls-tree: test for the regression in 9c4d58ff2c3
     
    -    Fix a regression introduced in 9c4d58ff2c3 (ls-tree: split up "fast
    -    path" callbacks, 2022-03-23), and improve the tests added in the
    -    1041d58b4d9 (Merge branch 'tl/ls-tree-oid-only', 2022-04-04) topic it
    -    was merged as part of to test the full expected output of various
    -    "ls-tree" options with and without -r.
    +    Add a test for the regression introduced in my 9c4d58ff2c3 (ls-tree:
    +    split up "fast path" callbacks, 2022-03-23) and fixed in
    +    350296cc789 (ls-tree: `-l` should not imply recursive listing,
    +    2022-04-04), and test for the test of ls-tree option/mode combinations
    +    to make sure we don't have other blind spots.
     
    -    Let's fix it, and also add tests not only for that blindspot, but also
    -    any other potential blindspots. To that end test the "modes" of -d, -r
    -    and -t (as well as "no mode") against all of the format options.
    +    The setup for these tests can be shared with those added in the
    +    1041d58b4d9 (Merge branch 'tl/ls-tree-oid-only', 2022-04-04) topic, so
    +    let's create a new t/lib-t3100.sh to help them share data.
     
    -    These tests all pass with that topic reverted (except those that would
    -    fail because they're testing the new --object-only feature introduced
    -    in that topic), which should give us confidence that there were no
    -    further regressions in this area.
    +    The existing tests in "t3104-ls-tree-format.sh" didn't deal with a
    +    submodule, which they'll now encounter with as the
    +    setup_basic_ls_tree_data() sets one up.
    +
    +    This extensive testing should give us confidence that there were no
    +    further regressions in this area. The lack of testing was noted back
    +    in [1], but unfortunately we didn't cover that blind-spot before
    +    9c4d58ff2c3.
    +
    +    1. https://lore.kernel.org/git/211115.86o86lqe3c.gmgdl@evledraar.gmail.com/
     
    -    Reported-By: Josh Steadmon <steadmon@google.com>
         Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
     
    - ## builtin/ls-tree.c ##
    -@@ builtin/ls-tree.c: static int show_tree_long(const struct object_id *oid, struct strbuf *base,
    - 	printf("%06o %s %s %7s\t", data.mode, type_name(data.type),
    - 	       find_unique_abbrev(data.oid, abbrev), size_text);
    - 	show_tree_common_default_long(base, pathname, data.base->len);
    --	return 1;
    -+	return recurse;
    - }
    - 
    - static int show_tree_name_only(const struct object_id *oid, struct strbuf *base,
    + ## t/lib-t3100.sh (new) ##
    +@@
    ++#!/bin/sh
    ++
    ++setup_basic_ls_tree_data () {
    ++	mkdir dir &&
    ++	test_commit dir/sub-file &&
    ++	test_commit top-file &&
    ++	git clone . submodule &&
    ++	git submodule add ./submodule &&
    ++	git commit -m"add submodule"
    ++}
     
      ## t/t3104-ls-tree-format.sh ##
    -@@ t/t3104-ls-tree-format.sh: test_ls_tree_format () {
    - 	fmtopts=$3 &&
    - 	shift 2 &&
    +@@ t/t3104-ls-tree-format.sh: test_description='ls-tree --format'
    + 
    + TEST_PASSES_SANITIZE_LEAK=true
    + . ./test-lib.sh
    ++. "$TEST_DIRECTORY"/lib-t3100.sh
    + 
    + test_expect_success 'ls-tree --format usage' '
    + 	test_expect_code 129 git ls-tree --format=fmt -l HEAD &&
    +@@ t/t3104-ls-tree-format.sh: test_expect_success 'ls-tree --format usage' '
    + '
    + 
    + test_expect_success 'setup' '
    +-	mkdir dir &&
    +-	test_commit dir/sub-file &&
    +-	test_commit top-file
    ++	setup_basic_ls_tree_data
    + '
      
    + test_ls_tree_format () {
    +
    + ## t/t3105-ls-tree-output.sh (new) ##
    +@@
    ++#!/bin/sh
    ++
    ++test_description='ls-tree output'
    ++
    ++TEST_PASSES_SANITIZE_LEAK=true
    ++. ./test-lib.sh
    ++. "$TEST_DIRECTORY"/lib-t3100.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' '
    ++	setup_basic_ls_tree_data
    ++'
    ++
    ++test_ls_tree_format_mode_output () {
    ++	local opts=$1 &&
    ++	shift &&
     +	cat >expect &&
    -+	cat <&6 >expect.-d &&
    -+	cat <&7 >expect.-r &&
    -+	cat <&8 >expect.-t &&
     +
    -+	for opt in '' '-d' '-r' '-t'
    ++	while test $# -gt 0
     +	do
    -+		test_expect_success "'ls-tree $opts${opt:+ $opt}' output" '
    -+			git ls-tree ${opt:+$opt }$opts $opt HEAD >actual &&
    -+			test_cmp expect${opt:+.$opt} actual
    ++		local mode="$1" &&
    ++		shift &&
    ++
    ++		test_expect_success "'ls-tree $opts${mode:+ $mode}' output" '
    ++			git ls-tree ${mode:+$mode }$opts HEAD >actual &&
    ++			test_cmp expect actual
     +		'
    ++
    ++		case "$opts" in
    ++		--full-tree)
    ++			test_expect_success "'ls-tree $opts${mode:+ $mode}' output (via subdir, fails)" '
    ++				test_must_fail git -C dir ls-tree --full-name ${mode:+$mode }$opts HEAD -- ../
    ++			'
    ++			;;
    ++		*)
    ++			test_expect_success "'ls-tree $opts${mode:+ $mode}' output (via subdir)" '
    ++				git -C dir ls-tree --full-name ${mode:+$mode }$opts HEAD -- ../ >actual &&
    ++				test_cmp expect actual
    ++			'
    ++			;;
    ++		esac
     +	done
    ++}
     +
    - 	test_expect_success "ls-tree '--format=<$format>' is like options '$opts $fmtopts'" '
    - 		git ls-tree $opts -r HEAD >expect &&
    - 		git ls-tree --format="$format" -r $fmtopts HEAD >actual &&
    -@@ t/t3104-ls-tree-format.sh: test_ls_tree_format () {
    - 
    - test_ls_tree_format \
    - 	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
    --	""
    -+	"" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	OUT_D
    -+	100644 blob $(git rev-parse HEAD:dir/sub-file.t)	dir/sub-file.t
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_R
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(objectmode) %(objecttype) %(objectname) %(objectsize:padded)%x09%(path)" \
    --	"--long"
    -+	"--long" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	040000 tree $(git rev-parse HEAD:dir)       -	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)       9	top-file.t
    -+	OUT
    -+	040000 tree $(git rev-parse HEAD:dir)       -	dir
    -+	OUT_D
    -+	100644 blob $(git rev-parse HEAD:dir/sub-file.t)      13	dir/sub-file.t
    -+	100644 blob $(git rev-parse HEAD:top-file.t)       9	top-file.t
    -+	OUT_R
    -+	040000 tree $(git rev-parse HEAD:dir)       -	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)       9	top-file.t
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(path)" \
    --	"--name-only"
    -+	"--name-only" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    ++# test exact output of option (none, --long, ...) and mode (none and
    ++# -d, -r -t) and combinations
    ++test_expect_success 'setup: HEAD_* variables' '
    ++	HEAD_gitmodules=$(git rev-parse HEAD:.gitmodules) &&
    ++	HEAD_dir=$(git rev-parse HEAD:dir) &&
    ++	HEAD_top_file=$(git rev-parse HEAD:top-file.t) &&
    ++	HEAD_submodule=$(git rev-parse HEAD:submodule) &&
    ++	HEAD_dir_sub_file=$(git rev-parse HEAD:dir/sub-file.t)
    ++'
    ++## opt =
    ++test_ls_tree_format_mode_output "" "" "-t" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++test_ls_tree_format_mode_output "" "-d" <<-EOF
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "" "-r" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	100644 blob $HEAD_dir_sub_file	dir/sub-file.t
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++## opt = --long
    ++test_ls_tree_format_mode_output "--long" "" "-t" <<-EOF
    ++	100644 blob $HEAD_gitmodules      61	.gitmodules
    ++	040000 tree $HEAD_dir       -	dir
    ++	160000 commit $HEAD_submodule       -	submodule
    ++	100644 blob $HEAD_top_file       9	top-file.t
    ++	EOF
    ++test_ls_tree_format_mode_output "--long" "-d" <<-EOF
    ++	040000 tree $HEAD_dir       -	dir
    ++	160000 commit $HEAD_submodule       -	submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "--long" "-r" <<-EOF
    ++	100644 blob $HEAD_gitmodules      61	.gitmodules
    ++	100644 blob $HEAD_dir_sub_file      13	dir/sub-file.t
    ++	160000 commit $HEAD_submodule       -	submodule
    ++	100644 blob $HEAD_top_file       9	top-file.t
    ++	EOF
    ++## opt = --name-only
    ++test_ls_tree_format_mode_output "--name-only" "" "-t" <<-EOF
    ++	.gitmodules
     +	dir
    ++	submodule
     +	top-file.t
    -+	OUT
    ++	EOF
    ++test_ls_tree_format_mode_output "--name-only" "-d" <<-EOF
     +	dir
    -+	OUT_D
    ++	submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "--name-only" "-r" <<-EOF
    ++	.gitmodules
     +	dir/sub-file.t
    ++	submodule
     +	top-file.t
    -+	OUT_R
    -+	dir
    -+	top-file.t
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(objectname)" \
    --	"--object-only"
    -+	"--object-only" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	$(git rev-parse HEAD:dir)
    -+	$(git rev-parse HEAD:top-file.t)
    -+	OUT
    -+	$(git rev-parse HEAD:dir)
    -+	OUT_D
    -+	$(git rev-parse HEAD:dir/sub-file.t)
    -+	$(git rev-parse HEAD:top-file.t)
    -+	OUT_R
    -+	$(git rev-parse HEAD:dir)
    -+	$(git rev-parse HEAD:top-file.t)
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(objectname)" \
    - 	"--object-only --abbrev" \
    --	"--abbrev"
    -+	"--abbrev" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	$(git rev-parse HEAD:dir | test_copy_bytes 7)
    -+	$(git rev-parse HEAD:top-file.t| test_copy_bytes 7)
    -+	OUT
    -+	$(git rev-parse HEAD:dir | test_copy_bytes 7)
    -+	OUT_D
    -+	$(git rev-parse HEAD:dir/sub-file.t | test_copy_bytes 7)
    -+	$(git rev-parse HEAD:top-file.t | test_copy_bytes 7)
    -+	OUT_R
    -+	$(git rev-parse HEAD:dir | test_copy_bytes 7)
    -+	$(git rev-parse HEAD:top-file.t | test_copy_bytes 7)
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
    - 	"-t" \
    --	"-t"
    -+	"-t" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	OUT_D
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:dir/sub-file.t)	dir/sub-file.t
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_R
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
    - 	"--full-name" \
    --	"--full-name"
    -+	"--full-name" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	OUT_D
    -+	100644 blob $(git rev-parse HEAD:dir/sub-file.t)	dir/sub-file.t
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_R
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_T
    - 
    - test_ls_tree_format \
    - 	"%(objectmode) %(objecttype) %(objectname)%x09%(path)" \
    - 	"--full-tree" \
    --	"--full-tree"
    -+	"--full-tree" \
    -+	<<-OUT 6<<-OUT_D 7<<-OUT_R 8<<-OUT_T
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	OUT_D
    -+	100644 blob $(git rev-parse HEAD:dir/sub-file.t)	dir/sub-file.t
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_R
    -+	040000 tree $(git rev-parse HEAD:dir)	dir
    -+	100644 blob $(git rev-parse HEAD:top-file.t)	top-file.t
    -+	OUT_T
    - 
    - test_done
    ++	EOF
    ++## opt = --object-only
    ++test_ls_tree_format_mode_output "--object-only" "" "-t" <<-EOF
    ++	$HEAD_gitmodules
    ++	$HEAD_dir
    ++	$HEAD_submodule
    ++	$HEAD_top_file
    ++	EOF
    ++test_ls_tree_format_mode_output "--object-only" "-d" <<-EOF
    ++	$HEAD_dir
    ++	$HEAD_submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "--object-only" "-r" <<-EOF
    ++	$HEAD_gitmodules
    ++	$HEAD_dir_sub_file
    ++	$HEAD_submodule
    ++	$HEAD_top_file
    ++	EOF
    ++## opt = --object-only --abbrev
    ++test_expect_success 'setup: HEAD_short_* variables' '
    ++	HEAD_short_gitmodules=$(git rev-parse --short HEAD:.gitmodules) &&
    ++	HEAD_short_dir=$(git rev-parse --short HEAD:dir) &&
    ++	HEAD_short_top_file=$(git rev-parse --short HEAD:top-file.t) &&
    ++	HEAD_short_submodule=$(git rev-parse --short HEAD:submodule) &&
    ++	HEAD_short_dir_sub_file=$(git rev-parse --short HEAD:dir/sub-file.t)
    ++'
    ++test_ls_tree_format_mode_output "--object-only --abbrev" "" "-t" <<-EOF
    ++	$HEAD_short_gitmodules
    ++	$HEAD_short_dir
    ++	$HEAD_short_submodule
    ++	$HEAD_short_top_file
    ++	EOF
    ++test_ls_tree_format_mode_output "--object-only --abbrev" "-d" <<-EOF
    ++	$HEAD_short_dir
    ++	$HEAD_short_submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "--object-only --abbrev" "-r" <<-EOF
    ++	$HEAD_short_gitmodules
    ++	$HEAD_short_dir_sub_file
    ++	$HEAD_short_submodule
    ++	$HEAD_short_top_file
    ++	EOF
    ++## opt = --full-name
    ++test_ls_tree_format_mode_output "--full-name" "" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++test_ls_tree_format_mode_output "--full-name" "-d" <<-EOF
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "--full-name" "-r" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	100644 blob $HEAD_dir_sub_file	dir/sub-file.t
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++test_ls_tree_format_mode_output "--full-name" "-t" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++## opt = --full-tree
    ++test_ls_tree_format_mode_output "--full-tree" "" "-t" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++test_ls_tree_format_mode_output "--full-tree" "-d" <<-EOF
    ++	040000 tree $HEAD_dir	dir
    ++	160000 commit $HEAD_submodule	submodule
    ++	EOF
    ++test_ls_tree_format_mode_output "--full-tree" "-r" <<-EOF
    ++	100644 blob $HEAD_gitmodules	.gitmodules
    ++	100644 blob $HEAD_dir_sub_file	dir/sub-file.t
    ++	160000 commit $HEAD_submodule	submodule
    ++	100644 blob $HEAD_top_file	top-file.t
    ++	EOF
    ++
    ++test_done

 t/lib-t3100.sh            |  10 ++
 t/t3104-ls-tree-format.sh |   5 +-
 t/t3105-ls-tree-output.sh | 192 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 204 insertions(+), 3 deletions(-)
 create mode 100644 t/lib-t3100.sh
 create mode 100755 t/t3105-ls-tree-output.sh

diff --git a/t/lib-t3100.sh b/t/lib-t3100.sh
new file mode 100644
index 00000000000..eabb5fd8034
--- /dev/null
+++ b/t/lib-t3100.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+setup_basic_ls_tree_data () {
+	mkdir dir &&
+	test_commit dir/sub-file &&
+	test_commit top-file &&
+	git clone . submodule &&
+	git submodule add ./submodule &&
+	git commit -m"add submodule"
+}
diff --git a/t/t3104-ls-tree-format.sh b/t/t3104-ls-tree-format.sh
index 0769a933d69..383896667b6 100755
--- a/t/t3104-ls-tree-format.sh
+++ b/t/t3104-ls-tree-format.sh
@@ -4,6 +4,7 @@ test_description='ls-tree --format'
 
 TEST_PASSES_SANITIZE_LEAK=true
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-t3100.sh
 
 test_expect_success 'ls-tree --format usage' '
 	test_expect_code 129 git ls-tree --format=fmt -l HEAD &&
@@ -12,9 +13,7 @@ test_expect_success 'ls-tree --format usage' '
 '
 
 test_expect_success 'setup' '
-	mkdir dir &&
-	test_commit dir/sub-file &&
-	test_commit top-file
+	setup_basic_ls_tree_data
 '
 
 test_ls_tree_format () {
diff --git a/t/t3105-ls-tree-output.sh b/t/t3105-ls-tree-output.sh
new file mode 100755
index 00000000000..29511d9331b
--- /dev/null
+++ b/t/t3105-ls-tree-output.sh
@@ -0,0 +1,192 @@
+#!/bin/sh
+
+test_description='ls-tree output'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-t3100.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' '
+	setup_basic_ls_tree_data
+'
+
+test_ls_tree_format_mode_output () {
+	local opts=$1 &&
+	shift &&
+	cat >expect &&
+
+	while test $# -gt 0
+	do
+		local mode="$1" &&
+		shift &&
+
+		test_expect_success "'ls-tree $opts${mode:+ $mode}' output" '
+			git ls-tree ${mode:+$mode }$opts HEAD >actual &&
+			test_cmp expect actual
+		'
+
+		case "$opts" in
+		--full-tree)
+			test_expect_success "'ls-tree $opts${mode:+ $mode}' output (via subdir, fails)" '
+				test_must_fail git -C dir ls-tree --full-name ${mode:+$mode }$opts HEAD -- ../
+			'
+			;;
+		*)
+			test_expect_success "'ls-tree $opts${mode:+ $mode}' output (via subdir)" '
+				git -C dir ls-tree --full-name ${mode:+$mode }$opts HEAD -- ../ >actual &&
+				test_cmp expect actual
+			'
+			;;
+		esac
+	done
+}
+
+# test exact output of option (none, --long, ...) and mode (none and
+# -d, -r -t) and combinations
+test_expect_success 'setup: HEAD_* variables' '
+	HEAD_gitmodules=$(git rev-parse HEAD:.gitmodules) &&
+	HEAD_dir=$(git rev-parse HEAD:dir) &&
+	HEAD_top_file=$(git rev-parse HEAD:top-file.t) &&
+	HEAD_submodule=$(git rev-parse HEAD:submodule) &&
+	HEAD_dir_sub_file=$(git rev-parse HEAD:dir/sub-file.t)
+'
+## opt =
+test_ls_tree_format_mode_output "" "" "-t" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+test_ls_tree_format_mode_output "" "-d" <<-EOF
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	EOF
+test_ls_tree_format_mode_output "" "-r" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	100644 blob $HEAD_dir_sub_file	dir/sub-file.t
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+## opt = --long
+test_ls_tree_format_mode_output "--long" "" "-t" <<-EOF
+	100644 blob $HEAD_gitmodules      61	.gitmodules
+	040000 tree $HEAD_dir       -	dir
+	160000 commit $HEAD_submodule       -	submodule
+	100644 blob $HEAD_top_file       9	top-file.t
+	EOF
+test_ls_tree_format_mode_output "--long" "-d" <<-EOF
+	040000 tree $HEAD_dir       -	dir
+	160000 commit $HEAD_submodule       -	submodule
+	EOF
+test_ls_tree_format_mode_output "--long" "-r" <<-EOF
+	100644 blob $HEAD_gitmodules      61	.gitmodules
+	100644 blob $HEAD_dir_sub_file      13	dir/sub-file.t
+	160000 commit $HEAD_submodule       -	submodule
+	100644 blob $HEAD_top_file       9	top-file.t
+	EOF
+## opt = --name-only
+test_ls_tree_format_mode_output "--name-only" "" "-t" <<-EOF
+	.gitmodules
+	dir
+	submodule
+	top-file.t
+	EOF
+test_ls_tree_format_mode_output "--name-only" "-d" <<-EOF
+	dir
+	submodule
+	EOF
+test_ls_tree_format_mode_output "--name-only" "-r" <<-EOF
+	.gitmodules
+	dir/sub-file.t
+	submodule
+	top-file.t
+	EOF
+## opt = --object-only
+test_ls_tree_format_mode_output "--object-only" "" "-t" <<-EOF
+	$HEAD_gitmodules
+	$HEAD_dir
+	$HEAD_submodule
+	$HEAD_top_file
+	EOF
+test_ls_tree_format_mode_output "--object-only" "-d" <<-EOF
+	$HEAD_dir
+	$HEAD_submodule
+	EOF
+test_ls_tree_format_mode_output "--object-only" "-r" <<-EOF
+	$HEAD_gitmodules
+	$HEAD_dir_sub_file
+	$HEAD_submodule
+	$HEAD_top_file
+	EOF
+## opt = --object-only --abbrev
+test_expect_success 'setup: HEAD_short_* variables' '
+	HEAD_short_gitmodules=$(git rev-parse --short HEAD:.gitmodules) &&
+	HEAD_short_dir=$(git rev-parse --short HEAD:dir) &&
+	HEAD_short_top_file=$(git rev-parse --short HEAD:top-file.t) &&
+	HEAD_short_submodule=$(git rev-parse --short HEAD:submodule) &&
+	HEAD_short_dir_sub_file=$(git rev-parse --short HEAD:dir/sub-file.t)
+'
+test_ls_tree_format_mode_output "--object-only --abbrev" "" "-t" <<-EOF
+	$HEAD_short_gitmodules
+	$HEAD_short_dir
+	$HEAD_short_submodule
+	$HEAD_short_top_file
+	EOF
+test_ls_tree_format_mode_output "--object-only --abbrev" "-d" <<-EOF
+	$HEAD_short_dir
+	$HEAD_short_submodule
+	EOF
+test_ls_tree_format_mode_output "--object-only --abbrev" "-r" <<-EOF
+	$HEAD_short_gitmodules
+	$HEAD_short_dir_sub_file
+	$HEAD_short_submodule
+	$HEAD_short_top_file
+	EOF
+## opt = --full-name
+test_ls_tree_format_mode_output "--full-name" "" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+test_ls_tree_format_mode_output "--full-name" "-d" <<-EOF
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	EOF
+test_ls_tree_format_mode_output "--full-name" "-r" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	100644 blob $HEAD_dir_sub_file	dir/sub-file.t
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+test_ls_tree_format_mode_output "--full-name" "-t" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+## opt = --full-tree
+test_ls_tree_format_mode_output "--full-tree" "" "-t" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+test_ls_tree_format_mode_output "--full-tree" "-d" <<-EOF
+	040000 tree $HEAD_dir	dir
+	160000 commit $HEAD_submodule	submodule
+	EOF
+test_ls_tree_format_mode_output "--full-tree" "-r" <<-EOF
+	100644 blob $HEAD_gitmodules	.gitmodules
+	100644 blob $HEAD_dir_sub_file	dir/sub-file.t
+	160000 commit $HEAD_submodule	submodule
+	100644 blob $HEAD_top_file	top-file.t
+	EOF
+
+test_done
-- 
2.36.1.1100.g16130010d07


  reply	other threads:[~2022-05-31 17:22 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                   ` [PATCH v11 11/13] ls-tree.c: introduce "--format" option Teng Long
2022-02-19  5:44                     ` Æ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                                           ` Ævar Arnfjörð Bjarmason [this message]
2022-06-02 15:18                                             ` [PATCH] ls-tree: test for the " 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

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

  git send-email \
    --in-reply-to=patch-1.1-0fdfec624eb-20220531T171908Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=congdanhqx@gmail.com \
    --cc=dyroneteng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=martin.agren@gmail.com \
    --cc=peff@peff.net \
    --cc=steadmon@google.com \
    --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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.