git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] t/lib-gpg: introduce new prereq GPG2

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 1, 2023, 08:39 UTC
Message-ID
<CAP8UFD1FkUJ0t0OosendGBQWZJC6AbntN4r7GmaVNVKHwHEc=w@mail.gmail.com>
In-Reply-To
<20230529192209.17747-2-five231003@gmail.com>

On Mon, May 29, 2023 at 9:23 PM Kousik Sanagavarapu <five231003@gmail.com> wrote:

Show 11 quoted lines
>
> GnuPG v2.0.0 released in 2006, which according to its release notes
>
>         https://gnupg.org/download/release_notes.html
>
> is the "First stable version of GnuPG integrating OpenPGP and S/MIME".
>
> Use this version or it's successors for tests that will fail for
> versions less than v2.0.0 because of the difference in the output on
> stderr between the versions (v2.* vs v0.* or v2.* vs v1.*). Skip if
> the GPG version detected is less than v2.0.0.

Yeah, I think it's reasonable to stop worrying about the output of GPG versions that are 17 year old.

Show 6 quoted lines
> +test_lazy_prereq GPG2 '
> +       gpg_version=$(gpg --version 2>&1)
> +       test $? != 127 || exit 1
> +
> +       case "$gpg_version" in
> +       !"gpg (GnuPG) 2."*)

Maybe something like `"gpg (GnuPG) 0."* | "gpg (GnuPG) 1."*)` would be better, as it would allow versions 3.X, 4.X, etc if they are ever released.

> +               say "This test requires a GPG version >= v2.0.0"
> +               exit 1
> +               ;;
Show 11 quoted lines
> diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
> index ccbc416402..96b316ae01 100755
> --- a/t/t7510-signed-commit.sh
> +++ b/t/t7510-signed-commit.sh
> @@ -218,6 +218,13 @@ test_expect_success GPG 'amending already signed commit' '
>         ! grep "BAD signature from" actual
>  '
>
> +test_expect_success GPG2 'bare signature' '
> +       git verify-commit fifth-signed 2>expect &&
> +       echo "" >>expect &&

We sometimes use `echo "" >` to add a new line, but we much more often use just `echo >` for that purpose:

$ git grep 'echo >' | wc -l 339 $ git grep 'echo "" >' | wc -l 16

> +       git log -1 --format="%GG" fifth-signed >actual &&
> +       test_cmp expect actual
> +'
Thanks!
Previous: Kousik SanagavarapuNext: Kousik Sanagavarapu
Message 3 of 19 in “Add new "signature" atom”
  1. Kousik SanagavarapuMay 29, 2023
  2. 1/2 t/lib-gpg: introduce new prereq GPG2Kousik Sanagavarapu, May 29, 2023
  3. Christian CouderJun 1, 2023
  4. 2/2 ref-filter: add new "signature" atomKousik Sanagavarapu, May 29, 2023
  5. Christian CouderJun 1, 2023
  6. Christian CouderJun 1, 2023
  7. 0/2 Add new "signature" atomKousik Sanagavarapu, Jun 2, 2023
  8. 1/2 t/lib-gpg: introduce new prereq GPG2Kousik Sanagavarapu, Jun 2, 2023
  9. Christian CouderJun 2, 2023
  10. Kousik SanagavarapuJun 2, 2023
  11. 2/2 ref-filter: add new "signature" atomKousik Sanagavarapu, Jun 2, 2023
  12. Oswald BuddenhagenJun 2, 2023
  13. Junio C HamanoJun 2, 2023
  14. Eric SunshineJun 2, 2023
  15. Junio C HamanoJun 3, 2023
  16. Kousik SanagavarapuJun 2, 2023
  17. 0/2 Add new "signature" atomKousik Sanagavarapu, Jun 4, 2023
  18. 1/2 t/lib-gpg: introduce new prereq GPG2Kousik Sanagavarapu, Jun 4, 2023
  19. 2/2 ref-filter: add new "signature" atomKousik Sanagavarapu, Jun 4, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.