From 7c5ff428a871cf3234ef9727150dd27d3882126a Mon Sep 17 00:00:00 2001 From: "interfect@b151490178830f44348aa57b77ad58c7d18e8fe7" Date: Fri, 16 Sep 2016 03:03:19 +0000 Subject: [PATCH] I got the files to come back, but I don't want Android making these dumb delete-loads-of-newly-added-stuff commits --- doc/bugs/Android_client_deletes_everything.mdwn | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/bugs/Android_client_deletes_everything.mdwn b/doc/bugs/Android_client_deletes_everything.mdwn index f4a3ef6eaa..677bdaf517 100644 --- a/doc/bugs/Android_client_deletes_everything.mdwn +++ b/doc/bugs/Android_client_deletes_everything.mdwn @@ -4,11 +4,11 @@ After not syncing my Android repo for a while, I tried to sync it. By some combi I then synced in my main direct mode crippled filesystem repo with the only copy of some files, and got a bunch of messages that Git Annex was deleting files I wanted to keep. I killed that sync with a ctrl+c. -My problem is: how do I revert the offending commit and restore my files? +My problem (***UPDATE**: solved) is: how do I revert the offending commit and restore my files? -My other question is: how do I prevent this happening again? Is there a way I can pre-clear commits and not accept those that delete files without manual confirmation? Or should I just stop being mean to the Android client and hope it doesn't decide to delete things it shouldn't delete again? +My other question (not yet solved) is: how do I prevent this happening again? Is there a way I can pre-clear commits and not accept those that delete files without manual confirmation? Or should I just stop being mean to the Android client and hope it doesn't decide to delete things it shouldn't delete again? -I've tried a "git annex proxy -- git revert HASHOFBADCOMMIT", but (as I killed Git Annex before it got through recording that it had trashed my files), I just get: +I've tried a `git annex proxy -- git revert HASHOFBADCOMMIT`, but (as I killed Git Annex before it got through recording that it had trashed my files), I just get: ``` error: Your local changes would be overwritten by revert. @@ -18,6 +18,8 @@ fatal: revert failed When syncing in a direct mode repo, does Git Annex happily delete the last copy of a file that appears to have been deleted somewhere else? Or does it save it until you manually clean up unused data, by moving it somewhere under .git? +**UPDATE**: A `git annex sync`, of all things, in the direct mode repository seems to have brought the files and their contents back. It created a commit that undid the deleting commit, except for the deletion of a duplicate copy of one file, which I don't need to have. + ### What steps will reproduce the problem? It's not entirely clear. Some combination of interrupting and restarting the Android app can make it think that files have been deleted when they really have never been created.