Thread (10 messages) flat view 10 messages, 5 authors, 2016-06-15

Re: [PATCH v2] make pack-objects a bit more resilient to repo corruption

From: Nicolas Pitre <nico@fluxnic.net>
Date: 2016-06-15 22:49:51

On Sat, 23 Oct 2010, Geert Bosch wrote:
On Oct 22, 2010, at 17:19, Nicolas Pitre wrote:
quoted
quoted
On Fri, Oct 22, 2010 at 13:26, Nicolas Pitre [off-list ref] wrote:
quoted
+                               static int warned = 0;
+                               if (!warned++)
+                                       warning("object %s cannot be read",
+                                               sha1_to_hex(src_entry->idx.sha1));
How does this handle multiple missing objects? Will it only warn for
the first one?
Yes, only the first one, so you have a bone to chase if that ever 
happens to you.  And that's good enough IMHO.  Trying to warn for every 
missing object would require extra storage per object to remember if any 
particular object was warned for already, which is I think overkill for 
an extremely unlikely event.  Comprehensive reporting is the job of 
fsck.
Maybe add a ", run git fsck" to the message. Will still comfortably fit a line.
Maybe if this message ever gets printed often enough.  Let's see if 
someone will even report it before 2012, and be clueless about it. And 
to be consistent, you'd have to do the same throughout the code where 
this could be relevant.

Furthermore, if someone really need the additional clue, then I'm afraid 
that the current fsck output won't help at all except to confuse that 
person even more.

Better for people to ask for help on this list when things break due to 
corruptions if they can't figure it out on their own.


Nicolas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help