From: Junio C Hamano <gitster@pobox.com>
To: "chenjianhu via GitGitGadget" <gitgitgadget@gmail.com>
Cc: Justin Tobler <jltobler@gmail.com>,
Kristoffer Haugsbakk <code@khaugsbakk.name>,
git@vger.kernel.org, chenjianhu <18230222379@163.com>,
chenjianhu <chenjianh@kylinos.cn>
Subject: Re: [PATCH v2] t7450: inspect the correct path a broken code would write to
Date: Thu, 31 Jul 2025 11:45:29 -0700 [thread overview]
Message-ID: <xmqqtt2sqjw6.fsf@gitster.g> (raw)
In-Reply-To: <pull.2022.v2.git.git.1753933780883.gitgitgadget@gmail.com> (chenjianhu via GitGitGadget's message of "Thu, 31 Jul 2025 03:49:40 +0000")
"chenjianhu via GitGitGadget" <gitgitgadget@gmail.com> writes:
Somehow Justin and Kristoffer are missing from the Cc list.
> From: chenjianhu <chenjianh@kylinos.cn>
>
> Prior to 05e9cd64 (config: quote values containing CR character,
> 2025-05-19), a repository can trick "clone --recurse-submodules"
> into running a post-checkout hook shipped with the project. The
> test was written to make sure the trick would no longer run the
> hook with the fix in the commit.
>
> However, the test did not check for the path the hook would
> create; correct the path to the expected one if the bug were
> still with us.
>
> Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>
> ---
> modify the “foo" file path to "$PWD/bad-clone/sub/foo".
>
> cc: "Kristoffer Haugsbakk" kristofferhaugsbakk@fastmail.com cc: Justin
> Tobler jltobler@gmail.com
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2022%2Fcjhxmx%2Fcjhxmx-git-test-v2
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2022/cjhxmx/cjhxmx-git-test-v2
> Pull-Request: https://github.com/git/git/pull/2022
>
> Range-diff vs v1:
>
> 1: c2d1d8fe884 ! 1: 6434587a075 modify the “foo" file path to "$PWD/bad-clone/sub/foo".
> @@
> ## Metadata ##
> -Author: 陈建虎 <chenjianhu@kylinos.cn>
> +Author: chenjianhu <chenjianh@kylinos.cn>
>
> ## Commit message ##
> - modify the “foo" file path to "$PWD/bad-clone/sub/foo".
> + t7450: inspect the correct path a broken code would write to
>
> - In the t7450-bad-git-dotfiles.sh, when post-checkout
> - is executed, the actual path where the foo file
> - is created should be "$PWD/bad-clone/sub/foo".
> + Prior to 05e9cd64 (config: quote values containing CR character,
> + 2025-05-19), a repository can trick "clone --recurse-submodules"
> + into running a post-checkout hook shipped with the project. The
> + test was written to make sure the trick would no longer run the
> + hook with the fix in the commit.
> +
> + However, the test did not check for the path the hook would
> + create; correct the path to the expected one if the bug were
> + still with us.
>
> Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>
>
>
>
> t/t7450-bad-git-dotfiles.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh
> index 14b5743b962..f512eed278c 100755
> --- a/t/t7450-bad-git-dotfiles.sh
> +++ b/t/t7450-bad-git-dotfiles.sh
> @@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d
> git -C repo commit -m submodule &&
>
> git -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&
> - ! test -f "$PWD/foo" &&
> + ! test -f "$PWD/bad-clone/sub/foo" &&
> test -f $(printf "bad-clone/sub\r/post-checkout")
> '
>
>
> base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c
next prev parent reply other threads:[~2025-07-31 18:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 7:25 [PATCH] modify the “foo" file path to "$PWD/bad-clone/sub/foo" 陈建虎 via GitGitGadget
2025-07-30 7:38 ` Kristoffer Haugsbakk
2025-07-30 15:09 ` Junio C Hamano
2025-07-30 15:47 ` Junio C Hamano
2025-07-30 18:08 ` Justin Tobler
2025-07-31 3:49 ` [PATCH v2] t7450: inspect the correct path a broken code would write to chenjianhu via GitGitGadget
2025-07-31 18:45 ` Junio C Hamano [this message]
2025-08-01 16:48 ` Justin Tobler
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=xmqqtt2sqjw6.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=18230222379@163.com \
--cc=chenjianh@kylinos.cn \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=jltobler@gmail.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).