Re: Error:non-monotonic index after failed recursive "sed" command
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jan 14, 2013, 12:06 UTC
- Message-ID
- <vpq38y42clj.fsf@grenoble-inp.fr>
- In-Reply-To
- <CAMoGvRKkSZqcoGtiebu6tuPndzOjQ1=JgQHb+iusAHpUbA2HbA@mail.gmail.com>
George Karpenkov <george@metaworld.ru> writes:
Show 7 quoted lines
> Hi All,
>
> I've managed to corrupt my very valuable repository with a recursive
> sed which went wrong.
> I wanted to convert all tabs to spaces with the following command:
>
> find ./ -name '*.*' -exec sed -i 's/\t/ /g' {} \;Clearly, this is a dangerous command as it impacts .git/. However, Git partially protects you from this kind of error, since object files and pack files are read-only by default.
My obvious first advice is: make backups of your corrupted repository. Yes, I said backup_s_, better safe than sorry.
Then, the errors you get are in *.idx files, which are basically index for pack files, for quicker access. You can try removing these files, and then running "git index-pack" on each pack file, like
$ rm .git/objects/pack/pack-*.idx $ git index-pack .git/objects/pack/pack-4745076928ca4df932a3727b8cc25e83574560bb.pack 4745076928ca4df932a3727b8cc25e83574560bb $ git index-pack .git/objects/pack/pack-c74a6514f653d0269cdcdf9c1c102d326706bbda.pack c74a6514f653d0269cdcdf9c1c102d326706bbda
-- Matthieu Moy http://www-verimag.imag.fr/~moy/