From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: phillip.wood@dunelm.org.uk,
"brian m. carlson" <sandals@crustytoothpaste.net>,
git@vger.kernel.org
Subject: Re: [PATCH 2/2] t0014: generate deprecated command names dynamically
Date: Tue, 28 Jul 2026 09:01:53 -0700 [thread overview]
Message-ID: <xmqqse53drwu.fsf@gitster.g> (raw)
In-Reply-To: <20260728143845.GB41686@coredump.intra.peff.net> (Jeff King's message of "Tue, 28 Jul 2026 10:38:45 -0400")
Jeff King <peff@peff.net> writes:
> We have a few tests related to aliasing of deprecated commands. They use
> whatchanged and pack-redundant because those are the only two deprecated
> commands we have. Eventually those commands will be removed, at which
> point these tests will be checking nothing useful (they'll just be
> regular aliases, which we already cover in other tests).
>
> We could remove them at that point, but the code to handle deprecated
> commands will still remain. We probably do want to keep the tests around
> for the eventual day that we deprecate more commands. So let's ask Git
> for its list of deprecated commands, and if we don't have any, skip
> those tests.
Ah, now I understand. So HAVE_DEPRECATED prerequisite guards tests
that require at least two deprecated commands, so that we can test
cases with aliases that involve two commands among deprecated ones
referring to each other. Obviously, with 0 or 1 deprecated commands,
there is no point to perform such tests.
Makes sense.
Thanks.
> diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh
> index 9d7c737355..cbc447b481 100755
> --- a/t/t0014-alias.sh
> +++ b/t/t0014-alias.sh
> @@ -27,10 +27,15 @@ test_expect_success 'looping aliases - internal execution' '
> test_grep "^fatal: alias loop detected: expansion of" output
> '
>
> -deprecated1=whatchanged
> -deprecated2=pack-redundant
> +test_expect_success 'detect deprecated commands' '
> + git --list-cmds=deprecated >deprecated &&
> + if read deprecated1 && read deprecated2
> + then
> + test_set_prereq HAVE_DEPRECATED
> + fi <deprecated
> +'
>
> -test_expect_success 'looping aliases - deprecated builtins' '
> +test_expect_success HAVE_DEPRECATED 'looping aliases - deprecated builtins' '
> test_config alias.$deprecated1 $deprecated2 &&
> test_config alias.$deprecated2 $deprecated1 &&
> cat >expect <<-EOF &&
> @@ -89,7 +94,7 @@ test_expect_success 'can alias-shadow deprecated builtins' '
> done
> '
>
> -test_expect_success 'can alias-shadow via two deprecated builtins' '
> +test_expect_success HAVE_DEPRECATED 'can alias-shadow via two deprecated builtins' '
> # some git(1) commands will fail... (see above)
> test_might_fail git status -h >expect &&
> test_file_not_empty expect &&
next prev parent reply other threads:[~2026-07-28 16:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 0:46 Failing tests with WITH_BREAKING_CHANGES brian m. carlson
2026-07-28 1:00 ` Junio C Hamano
2026-07-28 13:31 ` Phillip Wood
2026-07-28 13:55 ` Jeff King
2026-07-28 14:36 ` [PATCH 0/2] fix serial tests without/with breaking-changes Jeff King
2026-07-28 14:37 ` [PATCH 1/2] t0014: factor out choice of deprecated commands Jeff King
2026-07-28 15:57 ` Junio C Hamano
2026-07-28 14:38 ` [PATCH 2/2] t0014: generate deprecated command names dynamically Jeff King
2026-07-28 16:01 ` Junio C Hamano [this message]
2026-07-28 16:19 ` Jeff King
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=xmqqse53drwu.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=phillip.wood@dunelm.org.uk \
--cc=sandals@crustytoothpaste.net \
/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