Re: [PATCH v2 6/6] version: introduce osversion.command config for os-version output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 17, 2025 at 5:47 AM Usman Akinyemi
<usmanakinyemi202@xxxxxxxxx> wrote:
> Currently by default, the new `os-version` capability only exchange the
> operating system name between servers and clients i.e "Linux" or
> "Windows".
>
> Let's introduce a new configuration option, `osversion.command`, to handle
> the string exchange between servers and clients. This option allows
> customization of the exchanged string by leveraging the output of the
> specified command. This customization might be especially useful on some
> quite uncommon platforms like NonStop where interesting OS information is
> available from other means than uname(2).
>
> If this new configuration option is not set, the `os-version` capability
> exchanges just the operating system name.
>
> Signed-off-by: Usman Akinyemi <usmanakinyemi202@xxxxxxxxx>
> ---
> diff --git a/t/t5555-http-smart-common.sh b/t/t5555-http-smart-common.sh
> @@ -150,6 +150,34 @@ test_expect_success 'git upload-pack --advertise-refs: v2' '
> +test_expect_success 'git upload-pack --advertise-refs: v2 with osVersion.command config set' '
> +       test_config osVersion.command "uname -srvm" &&
> +       printf "agent=FAKE" >agent_and_long_osversion &&
> +
> +       if test_have_prereq !WINDOWS
> +       then
> +               printf "\nos-version=%s\n" $(uname -srvm | test_redact_non_printables) >>agent_and_long_osversion
> +       fi &&

As an aid to future readers, please add an explanation either in the
commit message or as a comment here in the code explaining why Windows
is being singled out as special.

> diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh
> @@ -53,6 +53,35 @@ test_expect_success 'test capability advertisement' '
> +test_expect_success 'test capability advertisement with osVersion.command config set' '
> +       test_config osVersion.command "uname -srvm" &&
> +       printf "agent=git/$(git version | cut -d" " -f3)" >agent_and_long_osversion &&
> +
> +       if test_have_prereq !WINDOWS
> +       then
> +               printf "\nos-version=%s\n" $(uname -srvm | test_redact_non_printables) >>agent_and_long_osversion
> +       fi &&

Ditto.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux