From: Justin Tobler Date: Tue, 10 Mar 2026 18:04:07 GMT Subject: Re: [PATCH v2 2/3] gpg-interface: introduce sign_buffer_with_key() Message-ID: In-Reply-To: On 26/03/10 10:01AM, Christian Couder wrote: > On Fri, Mar 6, 2026 at 9:54 PM Justin Tobler wrote: > > > > 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 resigning invalid commit signatures. > > Nit: s/resigning/re-signing/ Will fix. > > Introduce `sign_buffer_with_key()` to centralize signing key resolution > > in gpg-interface to allow callers to reuse the same behavior without > > duplicating logic. > > Nit: I think it would be a bit clearer if the change was described as: > > - moving the `sign_commit_to_strbuf()` helper from "commit.c" to > "gpg-interface.c", > - renaming it to `sign_buffer_with_key()`, and > - exporting it (so it can later be used by both "commit.c" and > "builtin/fast-import.c"). > > Or did I miss something? That's correct. I'll update the commit message in the next version to try to be a bit more clear here. Thanks. -Justin