git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Teng Long <dyroneteng@gmail.com>
Cc: git@vger.kernel.org, tenglong.tl@alibaba-inc.com
Subject: Re: [PATCH 6/6] t3104: remove shift code in 'test_ls_tree_format'
Date: Thu, 12 Jan 2023 15:56:22 +0100	[thread overview]
Message-ID: <230112.86cz7j23x0.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <20230112091135.20050-7-tenglong.tl@alibaba-inc.com>


On Thu, Jan 12 2023, Teng Long wrote:

> From: Teng Long <dyroneteng@gmail.com>
>
> In t3104-ls-tree-format.sh, There is a legacy 'shift 2' code
> and the relevant code block no longer depends on it anymore,
> so let's remove it for a small cleanup.

Like with 6/6, we can do without an update for this, but if you're
updating I'd say something like this instead:

	The "shift 2" added here when these tests were added in
	455923e0a15 (ls-tree: introduce "--format" option, 2022-03-23)
	has never been need. Let's remove it, as we're not in the habit
	of clearing arguments from "$@" unless we need to use "$@"
	itself (or "$*") later.

FWIW I think this dates back to my
https://lore.kernel.org/git/RFC-patch-6.7-eac299f06ff-20211217T131635Z-avarab@gmail.com/;
where there was no reason to do it either. I wouldn't normally "shift"
for no reason, so it probably dates back to some earlier version where I
used "$@", which didn't make it to the list.

> Signed-off-by: Teng Long <dyroneteng@gmail.com>
> ---
>  t/t3104-ls-tree-format.sh | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/t/t3104-ls-tree-format.sh b/t/t3104-ls-tree-format.sh
> index 383896667b6..74053978f49 100755
> --- a/t/t3104-ls-tree-format.sh
> +++ b/t/t3104-ls-tree-format.sh
> @@ -20,7 +20,6 @@ test_ls_tree_format () {
>  	format=$1 &&
>  	opts=$2 &&
>  	fmtopts=$3 &&
> -	shift 2 &&
>  
>  	test_expect_success "ls-tree '--format=<$format>' is like options '$opts $fmtopts'" '
>  		git ls-tree $opts -r HEAD >expect &&


  reply	other threads:[~2023-01-12 15:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  9:11 [PATCH 0/6] ls-tree.c: clean-up works Teng Long
2023-01-12  9:11 ` [PATCH 1/6] ls-tree: don't use "show_tree_data" for "fast" callbacks Teng Long
2023-01-12  9:11 ` [PATCH 2/6] ls-tree: use a "struct options" Teng Long
2023-01-12  9:11 ` [PATCH 3/6] ls-tree: fold "show_tree_data" into "cb" struct Teng Long
2023-01-12  9:11 ` [PATCH 4/6] ls-tree: make "line_termination" less generic Teng Long
2023-01-12  9:11 ` [PATCH 5/6] ls-tree: cleanup the redundant SPACE Teng Long
2023-01-12 14:53   ` Ævar Arnfjörð Bjarmason
2023-01-12  9:11 ` [PATCH 6/6] t3104: remove shift code in 'test_ls_tree_format' Teng Long
2023-01-12 14:56   ` Ævar Arnfjörð Bjarmason [this message]
2023-01-12 15:02 ` [PATCH 0/6] ls-tree.c: clean-up works Ævar Arnfjörð Bjarmason

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=230112.86cz7j23x0.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=dyroneteng@gmail.com \
    --cc=git@vger.kernel.org \
    --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 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 NNTP newsgroup(s).