diff options
author | Joey Hess <joey@kitenet.net> | 2013-10-18 15:20:44 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-10-18 15:20:44 -0400 |
commit | ce0dfeb488173ebace62079db788694283012d19 (patch) | |
tree | 5d934a0dec5668224475a5cdf2c4a389ea458f22 /doc/design | |
parent | 516517391f91568b28c2f2755552d1e585e6b9fa (diff) |
update
Diffstat (limited to 'doc/design')
-rw-r--r-- | doc/design/assistant/disaster_recovery.mdwn | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/doc/design/assistant/disaster_recovery.mdwn b/doc/design/assistant/disaster_recovery.mdwn index f96cf520b..875c83894 100644 --- a/doc/design/assistant/disaster_recovery.mdwn +++ b/doc/design/assistant/disaster_recovery.mdwn @@ -111,23 +111,28 @@ be parsed from git fsck output, but for eg blobs, the commits need to be walked to walk the trees, to find trees that refer to the blobs. For each branch that is affected, look in the reflog and/or `git log -$branch` to find the last good change that predates all broken commits. (If +$branch` to find the last good commit that predates all broken commits. (If the head commit of a branch is broken, git log is not going to show anything useful, but the reflog can be used to find past refs for the branch -- have to first delete the .git/HEAD file if it points to the broken ref.) -Reset the branch to the last good change. For the head branch, this will -leave git showing any changes made since then as staged in the index and -uncommitted. Or if the index is missing/corrupt, any files in the tree will -show as modified and uncommitted. User (or git-annex assistant) can then -commit as appropriate. - -(Special handling for git-annex branch: Commit .git/annex/index over -top of the reset git-annex branch, and then run a `git annex fsck --fast` -to fix up any object location info.) - -Also should check all remote tracking branches. If such a branch refers -to a missing object, it is sufficient to remove the tracking -branch and then `git fetch` from the remote, which will re-download missing -objects from it and reinstate the tracking branch. +The basic idea then is to reset the branch to the last good commit +that was found for it. (Or if no good commit was found, reset the branch to +a synthetic commit of an empty tree.) The details of how to do that +depends on the branch: + +* For the HEAD branch, can just reset it. This will + leave git showing any changes made since then as staged in the index and + uncommitted. Or if the index is missing/corrupt, any files in the tree will + show as modified and uncommitted. User (or git-annex assistant) can then + commit as appropriate. Print appropriate warning message. +* Special handling for git-annex branch: Reset to last good commit, and + then commit `.git/annex/index` over top of that, and then run a + `git annex fsck --fast` to fix up any object location info. +* Remote tracking branches can just be removed, and then `git fetch` + from the remote, which will re-download missing objects from it and + reinstate the tracking branch. +* For other branches (or tags), it's best to not rewrite them, because + that could get really confusing. Instead, delete the old broken branch, + and make a "recovered/$branch" that holds the last good commit. |