public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "René Scharfe" <l.s.r@web•de>
Cc: Git List <git@vger•kernel.org>
Subject: Re: [PATCH] t4014: support Git version strings with spaces
Date: Sat, 13 Dec 2025 17:42:24 +0900	[thread overview]
Message-ID: <xmqqsedeai33.fsf@gitster.g> (raw)
In-Reply-To: <eb0e6533-44ef-4b85-b1aa-f43f6d4174a4@web.de> ("René Scharfe"'s message of "Sat, 13 Dec 2025 09:03:00 +0100")

René Scharfe <l.s.r@web•de> writes:

> git --version reports its version with the prefix "git version ".
> Remove precisely this string instead of everything up to and including
> the first space to avoid butchering version strings that contain spaces.

"everything up to and including the last (rightmost) space"?

> This helps Apple's release of Git, which reports its version like this:
> "git version 2.50.1 (Apple Git-155)".

Sounds sensible.

> Signed-off-by: René Scharfe <l.s.r@web•de>
> ---
> Not an Apple patch.  They use sed(1) instead, which inadvertently hides
> the return code of git:
>
> https://github.com/apple-oss-distributions/Git/blob/6b2f9bfe72d6d4b5c9bcc1c2d0236c026d321cba/src/git/t/t4014-format-patch.sh#L982
>
>  t/t4014-format-patch.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
> index 2782b1fc18..21d6d0cd9e 100755
> --- a/t/t4014-format-patch.sh
> +++ b/t/t4014-format-patch.sh
> @@ -980,7 +980,7 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' '
>  
>  test_expect_success 'get git version' '
>  	git_version=$(git --version) &&
> -	git_version=${git_version##* }
> +	git_version=${git_version#git version }
>  '
>  
>  signature() {

  reply	other threads:[~2025-12-13  8:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-13  8:03 [PATCH] t4014: support Git version strings with spaces René Scharfe
2025-12-13  8:42 ` Junio C Hamano [this message]
2025-12-13  8:49   ` René Scharfe
2025-12-13  9:40 ` [PATCH v2] " René Scharfe

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=xmqqsedeai33.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=l.s.r@web$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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