Re: [PATCH v6 2/3] gpg-interface: allow sign_buffer() to use default signing key
On Thu, Mar 12, 2026 at 08:39:37PM -0500, Justin Tobler wrote:
Show 12 quoted lines
> The `sign_commit_to_strbuf()` helper in "commit.c" provides fallback
> logic to get the default configured signing key when a key is not
> provided and handles generating the commit signature accordingly. This
> signing operation is not really specific to commits as any arbitrary
> buffer can be signed. Also, in a subsequent commit, this same logic is
> reused by git-fast-import(1) when signing commits with invalid
> signatures.
>
> Remove the `sign_commit_to_strbuf()` helper from "commit.c" and extend
> `sign_buffer()` in "gpg-interface.c" to support using the default key as
> a fallback when the `SIGN_BUFFER_USE_DEFAULT_KEY` flag is provided. Call
> sites are updated accordingly.
Thanks, this looks much nicer to me now.
Patrick