git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@fluxnic.net>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <gitster@pobox.com>,
	Juliusz Chroboczek <jch@pps.jussieu.fr>,
	git@vger.kernel.org
Subject: Re: git-format-patch should include a checksum
Date: Tue, 26 Jan 2010 20:13:56 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.1001262006150.1681@xanadu.home> (raw)
In-Reply-To: <fabb9a1e1001261650r18e04e3cw2efade6072a426b@mail.gmail.com>

On Wed, 27 Jan 2010, Sverre Rabbelier wrote:

> 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.

> > 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

  reply	other threads:[~2010-01-27  1:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 22:34 git-format-patch should include a checksum Juliusz Chroboczek
2010-01-26 23:15 ` Sverre Rabbelier
2010-01-26 23:21 ` Junio C Hamano
2010-01-26 23:26   ` Sverre Rabbelier
2010-01-27  0:45     ` Linus Torvalds
2010-01-27  0:50       ` Sverre Rabbelier
2010-01-27  1:13         ` Nicolas Pitre [this message]
2010-01-27  1:25           ` Junio C Hamano
2010-01-27  1:25   ` Juliusz Chroboczek
2010-01-27  1:35     ` Junio C Hamano
2010-01-27  3:01     ` Junio C Hamano

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=alpine.LFD.2.00.1001262006150.1681@xanadu.home \
    --to=nico@fluxnic.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jch@pps.jussieu.fr \
    --cc=srabbelier@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /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).