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

Re: [PATCH v4 3/3] fast-import: add mode to sign commits with invalid signatures

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 12, 2026, 14:22 UTC
Message-ID
<abLMCxWWNiCnqmp_@pks.im>
In-Reply-To
<abLGgq-PXzdWs6kD@denethor>
On Thu, Mar 12, 2026 at 09:08:46AM -0500, Justin Tobler wrote:
Show 42 quoted lines
> On 26/03/12 11:23AM, Patrick Steinhardt wrote:
> > On Wed, Mar 11, 2026 at 12:31:47PM -0500, Justin Tobler wrote:
> > > diff --git a/builtin/fast-import.c b/builtin/fast-import.c
> > > index b8a7757cfd..d6281ff119 100644
> > > --- a/builtin/fast-import.c
> > > +++ b/builtin/fast-import.c
> > > @@ -2865,6 +2855,66 @@ static void handle_strip_if_invalid(struct strbuf *new_data,
> > >  		else
> > >  			warning(_("stripping invalid signature for commit\n"
> > >  				  "  allegedly by %s"), signer);
> > > +		break;
> > > +	case SIGN_SIGN_IF_INVALID:
> > > +		if (subject_len > 100)
> > > +			warning(_("signing commit with invalid signature for '%.100s...'\n"
> > > +				  "  allegedly by %s"), subject, signer);
> > > +		else if (subject_len > 0)
> > > +			warning(_("signing commit with invalid signature for '%.*s'\n"
> > > +				  "  allegedly by %s"), subject_len, subject, signer);
> > > +		else
> > > +			warning(_("signing commit with invalid signature\n"
> > > +				  "  allegedly by %s"), signer);
> > > +		break;
> > > +	default:
> > > +		BUG("unsupported signing mode");
> > > +	}
> > > +}
> > 
> > I'm still not convinced that it makes sense to warn about this case.
> > After all the user has asked us to re-sign such commits, so they
> > probably expect such cases. These warnings would thus result in a ton of
> > noise in a repository where most commits are signed, drowning out the
> > potentially-useful warnings.
> > 
> > Anyway, I won't insist on a change here.
> 
> I'm not really against removing these warning as I also agree it creates
> a bunch of noise. If we get rid of them for "sign-if-invalid" though,
> shouldn't we also get rid of them for "strip-if-invalid"? If the user
> asks to strip commits, I figure they would expect such cases as well. If
> we think removing the warning altogether is sensible, I can add another
> prepatory commit that simply removes the warning for the
> "strip-if-invalid" case.

Yeah, it kind of falls into the same space, agreed. As said, I won't insist on changing this. Maybe the right way to approach this is to keep it as-is for now and create a follow-up patch where you propose to strip it from both sites?

Patrick
Previous: Justin ToblerNext: Justin Tobler
Message 39 of 60 in “fast-import: add mode to re-sign invalid commit signatures”
  1. 0/2 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Feb 23, 2026
  2. 1/2 commit: remove unused forward declarationJustin Tobler, Feb 23, 2026
  3. Patrick SteinhardtFeb 24, 2026
  4. 2/2 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Feb 23, 2026
  5. Patrick SteinhardtFeb 24, 2026
  6. Justin ToblerFeb 24, 2026
  7. Christian CouderFeb 24, 2026
  8. brian m. carlsonFeb 24, 2026
  9. Junio C HamanoFeb 24, 2026
  10. Justin ToblerMar 2, 2026
  11. 0/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 6, 2026
  12. 1/3 commit: remove unused forward declarationJustin Tobler, Mar 6, 2026
  13. 2/3 gpg-interface: introduce sign_buffer_with_key()Justin Tobler, Mar 6, 2026
  14. Christian CouderMar 10, 2026
  15. Justin ToblerMar 10, 2026
  16. 3/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 6, 2026
  17. Christian CouderMar 10, 2026
  18. Justin ToblerMar 10, 2026
  19. 0/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 10, 2026
  20. 1/3 commit: remove unused forward declarationJustin Tobler, Mar 10, 2026
  21. Junio C HamanoMar 10, 2026
  22. 2/3 gpg-interface: introduce sign_buffer_with_key()Justin Tobler, Mar 10, 2026
  23. Junio C HamanoMar 10, 2026
  24. 3/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 10, 2026
  25. Junio C HamanoMar 10, 2026
  26. Justin ToblerMar 10, 2026
  27. Junio C HamanoMar 10, 2026
  28. Justin ToblerMar 10, 2026
  29. Junio C HamanoMar 10, 2026
  30. Justin ToblerMar 10, 2026
  31. 0/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 11, 2026
  32. 1/3 commit: remove unused forward declarationJustin Tobler, Mar 11, 2026
  33. 2/3 gpg-interface: introduce sign_buffer_with_key()Justin Tobler, Mar 11, 2026
  34. Patrick SteinhardtMar 12, 2026
  35. Justin ToblerMar 12, 2026
  36. 3/3 fast-import: add mode to sign commits with invalid signaturesJustin Tobler, Mar 11, 2026
  37. Patrick SteinhardtMar 12, 2026
  38. Justin ToblerMar 12, 2026
  39. Patrick SteinhardtMar 12, 2026
  40. Justin ToblerMar 12, 2026
  41. 0/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 12, 2026
  42. 1/3 commit: remove unused forward declarationJustin Tobler, Mar 12, 2026
  43. 2/3 gpg-interface: allow sign_buffer() to use default signing keyJustin Tobler, Mar 12, 2026
  44. Junio C HamanoMar 12, 2026
  45. Justin ToblerMar 12, 2026
  46. 3/3 fast-import: add mode to sign commits with invalid signaturesJustin Tobler, Mar 12, 2026
  47. Junio C HamanoMar 12, 2026
  48. Justin ToblerMar 12, 2026
  49. Jeff KingMar 12, 2026
  50. Justin ToblerMar 13, 2026
  51. Junio C HamanoMar 12, 2026
  52. Justin ToblerMar 12, 2026
  53. 0/3 fast-import: add mode to re-sign invalid commit signaturesJustin Tobler, Mar 13, 2026
  54. 1/3 commit: remove unused forward declarationJustin Tobler, Mar 13, 2026
  55. 2/3 gpg-interface: allow sign_buffer() to use default signing keyJustin Tobler, Mar 13, 2026
  56. Patrick SteinhardtMar 13, 2026
  57. 3/3 fast-import: add mode to sign commits with invalid signaturesJustin Tobler, Mar 13, 2026
  58. Patrick SteinhardtMar 13, 2026
  59. Junio C HamanoMar 13, 2026
  60. Patrick SteinhardtMar 13, 2026

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.