From: Junio C Hamano <gitster@pobox.com>
To: Christian Couder <christian.couder@gmail.com>
Cc: Olamide Caleb Bello <belkid98@gmail.com>,
git@vger.kernel.org, usmanakinyemi202@gmail.com
Subject: Re: [Outreachy PATCH v2 1/2] gpg-interface: replace strbuf_split_max() with string_list_split()
Date: Fri, 17 Oct 2025 11:47:16 -0700 [thread overview]
Message-ID: <xmqqv7kdz7pn.fsf@gitster.g> (raw)
In-Reply-To: <CAP8UFD1FMwrBxbZ6Ck8JwBPBOAhB039US6pHSTusb6qzW=crpg@mail.gmail.com> (Christian Couder's message of "Fri, 17 Oct 2025 11:15:37 +0200")
Christian Couder <christian.couder@gmail.com> writes:
> It seems to me that fingerprint_stdout should contain something like:
>
> 4096 SHA256:PelI2esT2xZlv20wJJyYOkQsli5RMK79oJ2VxqYb2PA
> christian.couder@gmail.com (RSA)
>
> and it looks like the 'key_size fingerprint_hash:fingerprint comment
> (key_type)' format is the standard `ssh-keygen -l` output.
>
> So I think it's safe to say that we should expect
> `string_list_split(..., 2)` to return 3. That should work even if
> there is no comment in the key file.
I do not know why you or anybody can think it is safe from what you
observed above, though. Who or which page of what manual told us
that the key owner's identity part cannot be missing?
> But on the other hand, I think it's also acceptable to say that we
> just want to keep the same behavior as the original code and check its
> return value with `> 1` since we only need the second element
> resulting from the split.
Yes, as a code clean-up topic, I think it is the *only* acceptable
thing to do. Finding the source to justify tightening of the rule
to validate data to insist we have to see 3 pieces can be left to a
separate topic once this series settles.
Thanks.
next prev parent reply other threads:[~2025-10-17 18:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-16 1:03 [Outreachy PATCH v2 0/2] gpg-interface.c: use string_list_split() instead of strbuf_split_max() Olamide Caleb Bello
2025-10-16 1:03 ` [Outreachy PATCH v2 1/2] gpg-interface: replace strbuf_split_max() with string_list_split() Olamide Caleb Bello
2025-10-16 17:27 ` Junio C Hamano
2025-10-17 9:15 ` Christian Couder
2025-10-17 10:07 ` Bello Olamide
2025-10-17 18:47 ` Junio C Hamano [this message]
2025-10-17 10:53 ` Bello Olamide
2025-10-16 1:03 ` [Outreachy PATCH v2 2/2] gpg-interface: use string_list_split() instead of strbuf_split_max() Olamide Caleb Bello
2025-10-17 7:58 ` [Outreachy PATCH v2 0/2] gpg-interface.c: " Christian Couder
2025-10-17 9:54 ` Bello Olamide
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=xmqqv7kdz7pn.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=belkid98@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=usmanakinyemi202@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).