Re: Recovering from repository corruption

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Denis Bueno <dbueno@...>
Cc: Git Mailing List <git@...>
Date: Tuesday, June 10, 2008 - 1:55 pm

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