From: John Keeping <john@keeping.me.uk>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: George Karpenkov <george@metaworld.ru>, git <git@vger.kernel.org>
Subject: Re: Error:non-monotonic index after failed recursive "sed" command
Date: Mon, 14 Jan 2013 12:12:47 +0000 [thread overview]
Message-ID: <20130114121247.GS4574@serenity.lan> (raw)
In-Reply-To: <vpq38y42clj.fsf@grenoble-inp.fr>
On Mon, Jan 14, 2013 at 01:06:16PM +0100, Matthieu Moy wrote:
> George Karpenkov <george@metaworld.ru> writes:
>> 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.
Having backed up the corrupt state, another option is to just try
running the reverse command:
find .git -name '*.*' -exec sed -i 's/ /\t/g' {} \;
I had a quick grep over some pack indices here and ' ' doesn't occur
in any of mine whereas '\t' is very common so you may find that the only
' ' sequences are the ones you introduced.
John
next prev parent reply other threads:[~2013-01-14 12:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 11:40 Error:non-monotonic index after failed recursive "sed" command George Karpenkov
2013-01-14 12:06 ` Matthieu Moy
2013-01-14 12:12 ` John Keeping [this message]
2013-01-14 12:21 ` Johannes Sixt
2013-01-14 19:06 ` Junio C Hamano
2013-01-14 19:13 ` Matthieu Moy
2013-01-14 22:57 ` George Karpenkov
2013-01-14 23:45 ` Philip Oakley
2013-01-15 0:54 ` George Karpenkov
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=20130114121247.GS4574@serenity.lan \
--to=john@keeping.me.uk \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=george@metaworld.ru \
--cc=git@vger.kernel.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).