{"thread":{"id":"63877","subject":"[PATCH] modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".","startedAt":"2025-07-30T07:25:03Z","lastAt":"2025-08-01T16:54:22Z","messageCount":8,"participants":["陈建虎 via GitGitGadget","Kristoffer Haugsbakk","Junio C Hamano","Justin Tobler","chenjianhu via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"522997","messageId":"pull.2022.git.git.1753860300588.gitgitgadget@gmail.com","threadId":"63877","inReplyTo":null,"subject":"[PATCH] modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".","fromName":"陈建虎 via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-07-30T07:25:00Z","receivedAt":"2025-07-30T07:25:03Z","isPatch":true,"sender":{"key":"name:陈建虎","avatar":null},"body":"From: =?UTF-8?q?=E9=99=88=E5=BB=BA=E8=99=8E?= <chenjianhu@kylinos.cn>\n\nIn the t7450-bad-git-dotfiles.sh, when post-checkout\nis executed, the actual path where the foo file\nis created should be \"$PWD/bad-clone/sub/foo\".\n\nSigned-off-by: chenjianhu <chenjianhu@kylinos.cn>\n---\n    modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2022%2Fcjhxmx%2Fcjhxmx-git-test-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2022/cjhxmx/cjhxmx-git-test-v1\nPull-Request: https://github.com/git/git/pull/2022\n\n t/t7450-bad-git-dotfiles.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh\nindex 14b5743b962..f512eed278c 100755\n--- a/t/t7450-bad-git-dotfiles.sh\n+++ b/t/t7450-bad-git-dotfiles.sh\n@@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d\n \tgit -C repo commit -m submodule &&\n \n \tgit -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&\n-\t! test -f \"$PWD/foo\" &&\n+\t! test -f \"$PWD/bad-clone/sub/foo\" &&\n \ttest -f $(printf \"bad-clone/sub\\r/post-checkout\")\n '\n \n\nbase-commit: e813a0200a7121b97fec535f0d0b460b0a33356c\n-- \ngitgitgadget\n"},{"id":"522998","messageId":"096f8beb-8156-49da-b905-3615bb6116c8@app.fastmail.com","threadId":"63877","inReplyTo":"pull.2022.git.git.1753860300588.gitgitgadget@gmail.com","subject":"Re: [PATCH] modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2025-07-30T07:38:33Z","receivedAt":"2025-07-30T07:38:55Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Wed, Jul 30, 2025, at 09:25, On Wed, Jul 30, 2025, at 09:25, 陈建虎 via GitGitGadget wrote:\n> From: =?UTF-8?q?=E9=99=88=E5=BB=BA=E8=99=8E?= <chenjianhu@kylinos.cn>\n> ...\n> Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>\n\nThe author name and signoff name should match.  Either “陈建虎” or the\n(I’m guessing) romanization “chenjianhu” for both.\n\n-- \nKristoffer Haugsbakk\n\n"},{"id":"523008","messageId":"xmqqfredn2b2.fsf@gitster.g","threadId":"63877","inReplyTo":"096f8beb-8156-49da-b905-3615bb6116c8@app.fastmail.com","subject":"Re: [PATCH] modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-30T15:09:05Z","receivedAt":"2025-07-30T15:09:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kristoffer Haugsbakk\" <kristofferhaugsbakk@fastmail.com> writes:\n\n> On Wed, Jul 30, 2025, at 09:25, On Wed, Jul 30, 2025, at 09:25, 陈建虎 via GitGitGadget wrote:\n>> From: =?UTF-8?q?=E9=99=88=E5=BB=BA=E8=99=8E?= <chenjianhu@kylinos.cn>\n>> ...\n>> Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>\n>\n> The author name and signoff name should match.  Either “陈建虎” or the\n> (I’m guessing) romanization “chenjianhu” for both.\n\nYup, either is fine but it would be nicer to non-east-asian friends\nto use the Anglicized form.\n\nThe title is what needs more polish than the name though.  \n"},{"id":"523012","messageId":"xmqq5xf9n0jf.fsf@gitster.g","threadId":"63877","inReplyTo":"pull.2022.git.git.1753860300588.gitgitgadget@gmail.com","subject":"Re: [PATCH] modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-30T15:47:16Z","receivedAt":"2025-07-30T15:47:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"陈建虎 via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: =?UTF-8?q?=E9=99=88=E5=BB=BA=E8=99=8E?= <chenjianhu@kylinos.cn>\n>\n> In the t7450-bad-git-dotfiles.sh, when post-checkout\n> is executed, the actual path where the foo file\n> is created should be \"$PWD/bad-clone/sub/foo\".\n\n\"is created\" is a bit iffy thing to say, as the test actually\nexpects the path _not_ to exist.\n\nAlso, pay special attention to what you say on your Subject: line.\n\n    Can I tell what area the change touches by only looking at the\n    Subject: line, especially when it is mixed with dozens of other\n    patch e-mails?\n\nis the question any author of a patch e-mail should be asking.\n\n    $ git log --no-merges --format=%s -100 | sort\n\nmay give us some inspirations.  For this one, perhaps I would have\nwritten\n\n    Subject: t7450: inspect the correct path a broken code would write to\n\n    Prior to 05e9cd64 (config: quote values containing CR character,\n    2025-05-19), a repository can trick \"clone --recurse-submodules\"\n    into running a post-checkout hook shipped with the project.  The\n    test was written to make sure the trick would no longer run the\n    hook with the fix in the commit.\n\n    However, the test did not check for the path the hook would\n    create; correct the path to the expected one if the bug were\n    still with us.\n\nor something like that.\n\nJustin, who wrote the test originally, Cc'ed for comments.\n\nThanks.\n\n> diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh\n> index 14b5743b962..f512eed278c 100755\n> --- a/t/t7450-bad-git-dotfiles.sh\n> +++ b/t/t7450-bad-git-dotfiles.sh\n> @@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d\n>  \tgit -C repo commit -m submodule &&\n>  \n>  \tgit -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&\n> -\t! test -f \"$PWD/foo\" &&\n> +\t! test -f \"$PWD/bad-clone/sub/foo\" &&\n>  \ttest -f $(printf \"bad-clone/sub\\r/post-checkout\")\n>  '\n"},{"id":"523026","messageId":"r3q4uyx6725ryuxnvnpidyaglptytro25pw4l53tg4vypkdruh@fmsgo5c6r4qd","threadId":"63877","inReplyTo":"xmqq5xf9n0jf.fsf@gitster.g","subject":"Re: [PATCH] modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2025-07-30T18:08:13Z","receivedAt":"2025-07-30T18:14:11Z","isPatch":true,"sender":{"key":"jltobler@gmail.com","avatar":"https://avatars.githubusercontent.com/u/53454972?v=4"},"body":"On 25/07/30 08:47AM, Junio C Hamano wrote:\n> \"陈建虎 via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n> > From: =?UTF-8?q?=E9=99=88=E5=BB=BA=E8=99=8E?= <chenjianhu@kylinos.cn>\n> \n> Justin, who wrote the test originally, Cc'ed for comments.\n> \n> > diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh\n> > index 14b5743b962..f512eed278c 100755\n> > --- a/t/t7450-bad-git-dotfiles.sh\n> > +++ b/t/t7450-bad-git-dotfiles.sh\n> > @@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d\n> >  \tgit -C repo commit -m submodule &&\n> >  \n> >  \tgit -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&\n> > -\t! test -f \"$PWD/foo\" &&\n> > +\t! test -f \"$PWD/bad-clone/sub/foo\" &&\n\nThis assertion is supposed to validate that the post-checkout hook did\nnot execute. The path here is incorrect indeed. I've tested the fix here\nand it works as expected. Thanks\n\n> >  \ttest -f $(printf \"bad-clone/sub\\r/post-checkout\")\n\nThe second assertion here still demonstrates that a file was not checked\nout into an arbitrary location, which is the root of the problem, and\nlikely why I missed this. Apologies. \n\n-Justin\n"},{"id":"523044","messageId":"pull.2022.v2.git.git.1753933780883.gitgitgadget@gmail.com","threadId":"63877","inReplyTo":"pull.2022.git.git.1753860300588.gitgitgadget@gmail.com","subject":"[PATCH v2] t7450: inspect the correct path a broken code would write to","fromName":"chenjianhu via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2025-07-31T03:49:40Z","receivedAt":"2025-07-31T03:49:44Z","isPatch":true,"sender":{"key":"name:chenjianhu","avatar":null},"body":"From: chenjianhu <chenjianh@kylinos.cn>\n\nPrior to 05e9cd64 (config: quote values containing CR character,\n2025-05-19), a repository can trick \"clone --recurse-submodules\"\ninto running a post-checkout hook shipped with the project.  The\ntest was written to make sure the trick would no longer run the\nhook with the fix in the commit.\n\nHowever, the test did not check for the path the hook would\ncreate; correct the path to the expected one if the bug were\nstill with us.\n\nSigned-off-by: chenjianhu <chenjianhu@kylinos.cn>\n---\n    modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n    \n    cc: \"Kristoffer Haugsbakk\" kristofferhaugsbakk@fastmail.com cc: Justin\n    Tobler jltobler@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2022%2Fcjhxmx%2Fcjhxmx-git-test-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2022/cjhxmx/cjhxmx-git-test-v2\nPull-Request: https://github.com/git/git/pull/2022\n\nRange-diff vs v1:\n\n 1:  c2d1d8fe884 ! 1:  6434587a075 modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n     @@\n       ## Metadata ##\n     -Author: 陈建虎 <chenjianhu@kylinos.cn>\n     +Author: chenjianhu <chenjianh@kylinos.cn>\n      \n       ## Commit message ##\n     -    modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n     +    t7450: inspect the correct path a broken code would write to\n      \n     -    In the t7450-bad-git-dotfiles.sh, when post-checkout\n     -    is executed, the actual path where the foo file\n     -    is created should be \"$PWD/bad-clone/sub/foo\".\n     +    Prior to 05e9cd64 (config: quote values containing CR character,\n     +    2025-05-19), a repository can trick \"clone --recurse-submodules\"\n     +    into running a post-checkout hook shipped with the project.  The\n     +    test was written to make sure the trick would no longer run the\n     +    hook with the fix in the commit.\n     +\n     +    However, the test did not check for the path the hook would\n     +    create; correct the path to the expected one if the bug were\n     +    still with us.\n      \n          Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>\n      \n\n\n t/t7450-bad-git-dotfiles.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh\nindex 14b5743b962..f512eed278c 100755\n--- a/t/t7450-bad-git-dotfiles.sh\n+++ b/t/t7450-bad-git-dotfiles.sh\n@@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d\n \tgit -C repo commit -m submodule &&\n \n \tgit -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&\n-\t! test -f \"$PWD/foo\" &&\n+\t! test -f \"$PWD/bad-clone/sub/foo\" &&\n \ttest -f $(printf \"bad-clone/sub\\r/post-checkout\")\n '\n \n\nbase-commit: e813a0200a7121b97fec535f0d0b460b0a33356c\n-- \ngitgitgadget\n"},{"id":"523114","messageId":"xmqqtt2sqjw6.fsf@gitster.g","threadId":"63877","inReplyTo":"pull.2022.v2.git.git.1753933780883.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] t7450: inspect the correct path a broken code would write to","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-31T18:45:29Z","receivedAt":"2025-07-31T18:45:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"chenjianhu via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\nSomehow Justin and Kristoffer are missing from the Cc list.\n\n> From: chenjianhu <chenjianh@kylinos.cn>\n>\n> Prior to 05e9cd64 (config: quote values containing CR character,\n> 2025-05-19), a repository can trick \"clone --recurse-submodules\"\n> into running a post-checkout hook shipped with the project.  The\n> test was written to make sure the trick would no longer run the\n> hook with the fix in the commit.\n>\n> However, the test did not check for the path the hook would\n> create; correct the path to the expected one if the bug were\n> still with us.\n>\n> Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>\n> ---\n>     modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n>     \n>     cc: \"Kristoffer Haugsbakk\" kristofferhaugsbakk@fastmail.com cc: Justin\n>     Tobler jltobler@gmail.com\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2022%2Fcjhxmx%2Fcjhxmx-git-test-v2\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2022/cjhxmx/cjhxmx-git-test-v2\n> Pull-Request: https://github.com/git/git/pull/2022\n>\n> Range-diff vs v1:\n>\n>  1:  c2d1d8fe884 ! 1:  6434587a075 modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n>      @@\n>        ## Metadata ##\n>      -Author: 陈建虎 <chenjianhu@kylinos.cn>\n>      +Author: chenjianhu <chenjianh@kylinos.cn>\n>       \n>        ## Commit message ##\n>      -    modify the “foo\" file path to \"$PWD/bad-clone/sub/foo\".\n>      +    t7450: inspect the correct path a broken code would write to\n>       \n>      -    In the t7450-bad-git-dotfiles.sh, when post-checkout\n>      -    is executed, the actual path where the foo file\n>      -    is created should be \"$PWD/bad-clone/sub/foo\".\n>      +    Prior to 05e9cd64 (config: quote values containing CR character,\n>      +    2025-05-19), a repository can trick \"clone --recurse-submodules\"\n>      +    into running a post-checkout hook shipped with the project.  The\n>      +    test was written to make sure the trick would no longer run the\n>      +    hook with the fix in the commit.\n>      +\n>      +    However, the test did not check for the path the hook would\n>      +    create; correct the path to the expected one if the bug were\n>      +    still with us.\n>       \n>           Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>\n>       \n>\n>\n>  t/t7450-bad-git-dotfiles.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh\n> index 14b5743b962..f512eed278c 100755\n> --- a/t/t7450-bad-git-dotfiles.sh\n> +++ b/t/t7450-bad-git-dotfiles.sh\n> @@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d\n>  \tgit -C repo commit -m submodule &&\n>  \n>  \tgit -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&\n> -\t! test -f \"$PWD/foo\" &&\n> +\t! test -f \"$PWD/bad-clone/sub/foo\" &&\n>  \ttest -f $(printf \"bad-clone/sub\\r/post-checkout\")\n>  '\n>  \n>\n> base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c\n"},{"id":"523226","messageId":"5hdj64ha2b5ewydtrra2rbzofgzaqnu2rt5enlarqs6u4grjsg@pkdsa6plxsuw","threadId":"63877","inReplyTo":"pull.2022.v2.git.git.1753933780883.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] t7450: inspect the correct path a broken code would write to","fromName":"Justin Tobler","fromEmail":"jltobler@gmail.com","sentAt":"2025-08-01T16:48:22Z","receivedAt":"2025-08-01T16:54:22Z","isPatch":true,"sender":{"key":"jltobler@gmail.com","avatar":"https://avatars.githubusercontent.com/u/53454972?v=4"},"body":"On 25/07/31 03:49AM, chenjianhu via GitGitGadget wrote:\n> From: chenjianhu <chenjianh@kylinos.cn>\n> \n> Prior to 05e9cd64 (config: quote values containing CR character,\n> 2025-05-19), a repository can trick \"clone --recurse-submodules\"\n> into running a post-checkout hook shipped with the project.  The\n> test was written to make sure the trick would no longer run the\n> hook with the fix in the commit.\n\nYep the first assertion in the test exists to ensure that the\npost-checkout hook in the submodule is not executed. The test also\nvalidates via its second assertion that the sumodule cannot be tricked\ninto being checked-out into a symlinked directory.\n\n> However, the test did not check for the path the hook would\n> create; correct the path to the expected one if the bug were\n> still with us.\n> \n> Signed-off-by: chenjianhu <chenjianhu@kylinos.cn>\n> ---\n[snip]\n> diff --git a/t/t7450-bad-git-dotfiles.sh b/t/t7450-bad-git-dotfiles.sh\n> index 14b5743b962..f512eed278c 100755\n> --- a/t/t7450-bad-git-dotfiles.sh\n> +++ b/t/t7450-bad-git-dotfiles.sh\n> @@ -401,7 +401,7 @@ test_expect_success SYMLINKS,!WINDOWS,!MINGW 'submodule must not checkout into d\n>  \tgit -C repo commit -m submodule &&\n>  \n>  \tgit -c protocol.file.allow=always clone --recurse-submodules repo bad-clone &&\n> -\t! test -f \"$PWD/foo\" &&\n> +\t! test -f \"$PWD/bad-clone/sub/foo\" &&\n\nYep, this is the correct path now. \n\nThis patch looks good to me. Thanks for fixing :)\n\n-Justin\n\n>  \ttest -f $(printf \"bad-clone/sub\\r/post-checkout\")\n>  '\n>  \n> \n> base-commit: e813a0200a7121b97fec535f0d0b460b0a33356c\n> -- \n> gitgitgadget\n> \n"}]}