Re: My git repo is broken, how to fix it ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/28/07, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
 - try to figure out why things got corrupted in the first place.
...
   But I would not be shocked to hear that the "link + unlink" sequence
   ends up being emulated under cygwin as a "copy + delete" due to lack of
   hardlinks or something.

Well, cygwin has a whole rename implementation using wincalls (which
may or maybe not syscalls). It's hard to tell whether micros$#%^ used
link+unlink: windows traditionally had no link(2). It has it since W2K,
allowed only on ntfs, and even there it spent some time undocumented :)

   Also, even if the link fails, and git then falls back to "rename()"
   (since some filesystems don't do hardlinks at all, or limit them to one
   particular directory), I would _still_ not be totally surprised if the
   rename got emulated as a copy/delete for some strange Windows reason.

   There are other possibilities for corruption, of course: just plain
   disk corruption, or (again) some other subtle cygwin emulation or
   Windows issue could bite us.

It is very hard to tell: the rename function in cygwin is over 200 lines long,
has multiple calls down to the kernel (or whatever it is), and there are two
different wincalls used. It is hard to predict what path will be taken or
whether there were actually any data copying happened.
Of course, windows known to corrupt data just so...

 - It would probably be good to write up the "How to recover" thing,
   regardless of why any corruption happens. It doesn't matter if you're
   under UNIX and using native protocols, and just being careful as hell:
   disks get corrupted, sh*t happens, alpha-particles in the wrong place
   do bad things to memory cells. And bugs _are_ inevitable, even if
   we've been pretty damn good about these things.

It'd be a good start to link the recent disaster recoveries from
git.or.cz wiki from the title page (unless it is already).
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]