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

Re: [PATCH v3 1/3] gpg-interface/gpgsm: fix for v2.3

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 2, 2022, 19:18 UTC
Message-ID
<xmqqh78gkvsm.fsf@gitster.g>
In-Reply-To
<20220302090250.590450-1-fs@gigacodes.de>
Fabian Stelzer <fs@gigacodes.de> writes:
> Checking if signing was successful will now accept '[GNUPG]:
> SIG_CREATED' on any beginning of a line. Not just explictly the second
> one anymore.

"the second or subsequent one", I would think, but the code change looks correct anyway.

> Switch to gpg's `--with-colons` output format to make
> parsing more robust.  This avoids issues where the
> human-readable output from gpg commands changes.
Does this refer only to how parsing in tests is done?
> Adjust error messages checking in tests for v2.3 specific output changes.

Does this refer only to the change to 4202 where "failed to find the" and the colon after "certificate" are made optional, so that the regexp can read messages from both pre- and post-2.3 versions?

Show 15 quoted lines
> diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
> index 3e7ee1386a..6bc083ca77 100644
> --- a/t/lib-gpg.sh
> +++ b/t/lib-gpg.sh
> @@ -72,12 +72,10 @@ test_lazy_prereq GPGSM '
>  		--passphrase-fd 0 --pinentry-mode loopback \
>  		--import "$TEST_DIRECTORY"/lib-gpg/gpgsm_cert.p12 &&
>  
> -	gpgsm --homedir "${GNUPGHOME}" -K |
> -	grep fingerprint: |
> -	cut -d" " -f4 |
> -	tr -d "\\n" >"${GNUPGHOME}/trustlist.txt" &&
> +	gpgsm --homedir "${GNUPGHOME}" -K --with-colons |
> +	awk -F ":" "/^fpr:/ {printf \"%s S relax\\n\", \$10}" \
> +		>"${GNUPGHOME}/trustlist.txt" &&

The old iteration had (fpr|fingerprint) which appeared as if it were catering to both pre- and post-2.3 versions, but "with colons", all versions we care about would say "fpr" and that is the reason why we no longer have such an alternative here? Just checking my understanding.

> -	echo " S relax" >>"${GNUPGHOME}/trustlist.txt" &&

This removal is because...? I do not recall seeing the explanation in the proposed log message.

Show 14 quoted lines
>  	echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \
>  	       -u committer@example.com -o /dev/null --sign -
>  '
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 55fac64446..d599bf4b11 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -2037,7 +2037,7 @@ test_expect_success GPGSM 'log --graph --show-signature for merged tag x509 miss
>  	git merge --no-ff -m msg signed_tag_x509_nokey &&
>  	GNUPGHOME=. git log --graph --show-signature -n1 plain-x509-nokey >actual &&
>  	grep "^|\\\  merged tag" actual &&
> -	grep "^| | gpgsm: certificate not found" actual
> +	grep -Ei "^| | gpgsm:( failed to find the)? certificate:? not found" actual
>  '

OK. It might be easier to read if we give two expressions separately and say "we can take either of these", i.e.

	# the former is from pre-2.3, the latter is from 2.3 and later
	grep -e "^| | gpgsm: certificate not found" \
	     -e "^| | gpgsm: failed to find the certificate: not found" \
	     actual
Thanks for working on this update.
Previous: Fabian StelzerNext: Fabian Stelzer
Message 18 of 24 in “gpg-interface: fix for gpgsm v2.3”
  1. gpg-interface: fix for gpgsm v2.3Fabian Stelzer, Feb 3, 2022
  2. Junio C HamanoFeb 3, 2022
  3. Todd ZullingerFeb 3, 2022
  4. Junio C HamanoFeb 3, 2022
  5. Todd ZullingerFeb 3, 2022
  6. Junio C HamanoFeb 3, 2022
  7. Fabian StelzerFeb 7, 2022
  8. Todd ZullingerFeb 7, 2022
  9. Fabian StelzerFeb 9, 2022
  10. Todd ZullingerFeb 9, 2022
  11. Fabian StelzerFeb 21, 2022
  12. Todd ZullingerFeb 23, 2022
  13. 2/3 t/lib-gpg: reload gpg components after updating trustlistFabian Stelzer, Feb 24, 2022
  14. 3/3 t/lib-gpg: kill all gpg components, not just gpg-agentFabian Stelzer, Feb 24, 2022
  15. 1/3 gpg-interface/gpgsm: fix for v2.3Fabian Stelzer, Feb 24, 2022
  16. Todd ZullingerFeb 28, 2022
  17. 1/3 gpg-interface/gpgsm: fix for v2.3Fabian Stelzer, Mar 2, 2022
  18. Junio C HamanoMar 2, 2022
  19. Fabian StelzerMar 3, 2022
  20. 1/3 gpg-interface/gpgsm: fix for v2.3Fabian Stelzer, Mar 4, 2022
  21. 3/3 t/lib-gpg: kill all gpg components, not just gpg-agentFabian Stelzer, Mar 4, 2022
  22. 2/3 t/lib-gpg: reload gpg components after updating trustlistFabian Stelzer, Mar 4, 2022
  23. 2/3 t/lib-gpg: reload gpg components after updating trustlistFabian Stelzer, Mar 2, 2022
  24. 3/3 t/lib-gpg: kill all gpg components, not just gpg-agentFabian Stelzer, Mar 2, 2022

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.