{"thread":{"id":"64620","subject":"[PATCH] t4014: support Git version strings with spaces","startedAt":"2025-12-13T08:03:08Z","lastAt":"2025-12-13T09:40:44Z","messageCount":4,"participants":["René Scharfe","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"532115","messageId":"eb0e6533-44ef-4b85-b1aa-f43f6d4174a4@web.de","threadId":"64620","inReplyTo":null,"subject":"[PATCH] t4014: support Git version strings with spaces","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2025-12-13T08:03:00Z","receivedAt":"2025-12-13T08:03:08Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"git --version reports its version with the prefix \"git version \".\nRemove precisely this string instead of everything up to and including\nthe first space to avoid butchering version strings that contain spaces.\nThis helps Apple's release of Git, which reports its version like this:\n\"git version 2.50.1 (Apple Git-155)\".\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\nNot an Apple patch.  They use sed(1) instead, which inadvertently hides\nthe return code of git:\n\nhttps://github.com/apple-oss-distributions/Git/blob/6b2f9bfe72d6d4b5c9bcc1c2d0236c026d321cba/src/git/t/t4014-format-patch.sh#L982\n\n t/t4014-format-patch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 2782b1fc18..21d6d0cd9e 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -980,7 +980,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '\n \n test_expect_success 'get git version' '\n \tgit_version=$(git --version) &&\n-\tgit_version=${git_version##* }\n+\tgit_version=${git_version#git version }\n '\n \n signature() {\n-- \n2.52.0\n"},{"id":"532127","messageId":"xmqqsedeai33.fsf@gitster.g","threadId":"64620","inReplyTo":"eb0e6533-44ef-4b85-b1aa-f43f6d4174a4@web.de","subject":"Re: [PATCH] t4014: support Git version strings with spaces","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-12-13T08:42:24Z","receivedAt":"2025-12-13T08:42:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> git --version reports its version with the prefix \"git version \".\n> Remove precisely this string instead of everything up to and including\n> the first space to avoid butchering version strings that contain spaces.\n\n\"everything up to and including the last (rightmost) space\"?\n\n> This helps Apple's release of Git, which reports its version like this:\n> \"git version 2.50.1 (Apple Git-155)\".\n\nSounds sensible.\n\n> Signed-off-by: René Scharfe <l.s.r@web.de>\n> ---\n> Not an Apple patch.  They use sed(1) instead, which inadvertently hides\n> the return code of git:\n>\n> https://github.com/apple-oss-distributions/Git/blob/6b2f9bfe72d6d4b5c9bcc1c2d0236c026d321cba/src/git/t/t4014-format-patch.sh#L982\n>\n>  t/t4014-format-patch.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> index 2782b1fc18..21d6d0cd9e 100755\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -980,7 +980,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '\n>  \n>  test_expect_success 'get git version' '\n>  \tgit_version=$(git --version) &&\n> -\tgit_version=${git_version##* }\n> +\tgit_version=${git_version#git version }\n>  '\n>  \n>  signature() {\n"},{"id":"532128","messageId":"1259f5a3-472c-4805-a6d2-8fb871de8922@web.de","threadId":"64620","inReplyTo":"xmqqsedeai33.fsf@gitster.g","subject":"Re: [PATCH] t4014: support Git version strings with spaces","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2025-12-13T08:49:52Z","receivedAt":"2025-12-13T08:49:56Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"On 12/13/25 9:42 AM, Junio C Hamano wrote:\n> René Scharfe <l.s.r@web.de> writes:\n> \n>> git --version reports its version with the prefix \"git version \".\n>> Remove precisely this string instead of everything up to and including\n>> the first space to avoid butchering version strings that contain spaces.\n> \n> \"everything up to and including the last (rightmost) space\"?\n\nUgh, yes, did that before.  Perhaps a variant of left-right confusion? :-|\n\nRené\n\n"},{"id":"532129","messageId":"b79cba1d-f32b-4034-979e-fb9528d05f18@web.de","threadId":"64620","inReplyTo":"eb0e6533-44ef-4b85-b1aa-f43f6d4174a4@web.de","subject":"[PATCH v2] t4014: support Git version strings with spaces","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2025-12-13T09:40:42Z","receivedAt":"2025-12-13T09:40:44Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"git --version reports its version with the prefix \"git version \".\nRemove precisely this string instead of everything up to and including\nthe rightmost space to avoid butchering version strings that contain\nspaces.  This helps Apple's release of Git, which reports its version\nlike this: \"git version 2.50.1 (Apple Git-155)\".\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\nChanges since v1:\n- fix description of current removal pattern in commit message\n\n t/t4014-format-patch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 2782b1fc18..21d6d0cd9e 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -980,7 +980,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '\n \n test_expect_success 'get git version' '\n \tgit_version=$(git --version) &&\n-\tgit_version=${git_version##* }\n+\tgit_version=${git_version#git version }\n '\n \n signature() {\n-- \n2.52.0\n"}]}