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

Re: git-format-patch should include a checksum

From
Nicolas Pitre <nico@fluxnic.net>
Date
Jan 27, 2010, 01:13 UTC
Message-ID
<alpine.LFD.2.00.1001262006150.1681@xanadu.home>
In-Reply-To
<fabb9a1e1001261650r18e04e3cw2efade6072a426b@mail.gmail.com>
On Wed, 27 Jan 2010, Sverre Rabbelier wrote:
Show 8 quoted lines
> Heya,
> 
> On Wed, Jan 27, 2010 at 01:45, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> > That wouldn't work either. People can, should, and do add extra things to
> > the message before applying it.
> 
> Ah, that's a fair point.

FWIW, I do manually edit both incoming and outgoing patches from time to time as well.

Show 10 quoted lines
> > In short, it might make sense to have some anti-corruption logic, but I
> > suspect it needs a lot of thought.
> 
> Perhaps it makes sense to make it a separate mode to git am, such that
> it only checks that the patch is not corrupted, but does not apply it.
> That way it would be possible to download the patch, check that it
> arrived unscathed, and then do your usual patch handling. Those who do
> not edit patches before applying it would be convenient to set a
> configuration option that automatically does it when applying the
> patch, either warning about it or aborting (as Juliusz suggested).

I think what would be even more useful at first is to find out why corrupted patches still apply.

And yet without any changes in the patch format, it should be possible to test the validity of a patch whenever the blob for the preimage SHA1 from the index line in the patch header is available locally. Just applying the patch to that blob and confirming it matches the postimage SHA1 should cover many cases already.

Nicolas
Previous: Sverre RabbelierNext: Junio C Hamano
Message 7 of 11 in “git-format-patch should include a checksum”
  1. Juliusz ChroboczekJan 26, 2010
  2. Sverre RabbelierJan 26, 2010
  3. Junio C HamanoJan 26, 2010
  4. Sverre RabbelierJan 26, 2010
  5. Linus TorvaldsJan 27, 2010
  6. Sverre RabbelierJan 27, 2010
  7. Nicolas PitreJan 27, 2010
  8. Junio C HamanoJan 27, 2010
  9. Juliusz ChroboczekJan 27, 2010
  10. Junio C HamanoJan 27, 2010
  11. Junio C HamanoJan 27, 2010

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.