Re: Recovering from repository corruption

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Narebski
Date: Tuesday, June 10, 2008 - 10:55 am

"Denis Bueno" <dbueno@gmail.com> writes:


Without checking Git User's Manual, I think the solution could go as
the following.

Assume that history looks like this

    ...---.---a---*---b---.---...

where by '*' is marked corruped commit (commit shich tree contains
corrupted blobs).

First, you can check the commit message for '*' using git-cat-file or
git-show, you can get the difference between 'a' and 'b' using 
"git diff a b".  When you know how repaired commit 'X' should look
like, do something like:

  $ git checkout -b <temp-branch> 'a'
  $ <edit edit edit>
  $ git commit

Then history would look like this

    ...---.---a---*---b---.---...
               \
                \-X

Now with grafts make 'b' be a child of 'X', i.e. modify parent of 'b'
for history to look like below:

    ...---.---a---*   b---.---...
               \     /
                \-X-/

Examine history using git-log, git-show, check tree with git-ls-tree
and examining files, use graphical history browser like gitk.

Then if possible use git-filter-branch to make history recorded in
grafts file permanent...

HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
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:
Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 10:26 am)
Re: Recovering from repository corruption, Jakub Narebski, (Tue Jun 10, 10:55 am)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 12:38 pm)
Re: Recovering from repository corruption, Nicolas Pitre, (Tue Jun 10, 12:40 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 12:42 pm)
Re: Recovering from repository corruption, Jakub Narebski, (Tue Jun 10, 12:59 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 1:03 pm)
Re: Recovering from repository corruption, Jakub Narebski, (Tue Jun 10, 1:14 pm)
Re: Recovering from repository corruption, Linus Torvalds, (Tue Jun 10, 1:23 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 1:28 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 1:35 pm)
Re: Recovering from repository corruption, Linus Torvalds, (Tue Jun 10, 2:09 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 2:22 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 2:27 pm)
Re: Recovering from repository corruption, Linus Torvalds, (Tue Jun 10, 2:48 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 3:09 pm)
Re: Recovering from repository corruption, Tarmigan, (Tue Jun 10, 3:25 pm)
Re: Recovering from repository corruption, Denis Bueno, (Tue Jun 10, 3:41 pm)
Re: Recovering from repository corruption, Linus Torvalds, (Tue Jun 10, 3:45 pm)
Re: Recovering from repository corruption, Junio C Hamano, (Tue Jun 10, 3:52 pm)
Re: Recovering from repository corruption, Linus Torvalds, (Tue Jun 10, 4:00 pm)
Re: Recovering from repository corruption, Nicolas Pitre, (Tue Jun 10, 5:43 pm)
Re: Recovering from repository corruption, Linus Torvalds, (Tue Jun 10, 6:39 pm)
Re: Recovering from repository corruption, Nicolas Pitre, (Tue Jun 10, 6:47 pm)
To graft or not to graft... (Re: Recovering from repositor ..., Stephen R. van den Berg, (Wed Jun 11, 4:21 pm)
Re: To graft or not to graft... (Re: Recovering from repos ..., Stephen R. van den Berg, (Thu Jun 12, 5:20 am)