Re: [RFC Patch] Preventing corrupt objects from entering the repository

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nicolas Pitre
Date: Tuesday, February 12, 2008 - 9:02 am

On Mon, 11 Feb 2008, Martin Koegler wrote:


OK that makes sense.

I think this is a good idea to always have some sanity checks on any 
incoming objects so to make sure they're well formed and valid before 
giving them a SHA1 value, and bail out as soon as any error is found.  
From my understanding that's what your patch is doing, right? (sorry I 
can't find them in my mailbox anymore).  This can be done as objects are 
coming in just fine and requires no extra memory, and I would say this 
should be done unconditionally all the time.  After all, the Git 
coherency model is based on the SHA1 checksuming, and therefore it is a 
good idea to never validate any malformed objects with a SHA1.  So I'm 
all in favor of such validation always performed in index-pack and 
unpack-objects.

As to making sure those objects are well connected... well this is a 
technically different issue entirely, and I wonder if a special mode to 
fsck might not be a better solution.  For example, fsck could be made to 
validate object connectivity, starting from the new ref(s), and stopping 
object walking as soon as a reference to an object not included in the 
newly received pack is encountered.  This could be run from some hook to 
decide whether or not to update the new refs, and to delete the pack 
otherwise.


Nicolas
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC Patch] Preventing corrupt objects from entering t ..., Nicolas Pitre, (Tue Feb 12, 9:02 am)
Re: [RFC Patch] Preventing corrupt objects from entering t ..., Johannes Schindelin, (Wed Feb 13, 5:01 am)
[RFC PATCH] Remove object-refs from fsck, Shawn O. Pearce, (Thu Feb 14, 2:00 am)
Re: [RFC PATCH] Remove object-refs from fsck, Martin Koegler, (Thu Feb 14, 12:07 pm)
Re: [RFC Patch] Preventing corrupt objects from entering t ..., Johannes Schindelin, (Thu Feb 14, 5:06 pm)