uninit: Preserve .git/annex/objects at the end, if it still has content, so that old versions of files and deleted files are not deleted. Print a message with some suggested actions.
This commit is contained in:
parent
57830554c0
commit
1d7d3ac325
3 changed files with 26 additions and 2 deletions
|
@ -62,9 +62,28 @@ startUnannex file info = do
|
||||||
start :: CommandStart
|
start :: CommandStart
|
||||||
start = next $ next $ do
|
start = next $ next $ do
|
||||||
annexdir <- fromRepo gitAnnexDir
|
annexdir <- fromRepo gitAnnexDir
|
||||||
|
annexobjectdir <- fromRepo gitAnnexObjectDir
|
||||||
|
present <- getKeysPresent
|
||||||
|
if null present
|
||||||
|
then liftIO $ removeDirectoryRecursive annexdir
|
||||||
|
else error $ unlines
|
||||||
|
[ "Not fully uninitialized"
|
||||||
|
, "Some annexed data is still left in " ++ annexobjectdir
|
||||||
|
, "This may include deleted files, or old versions of modified files."
|
||||||
|
, ""
|
||||||
|
, "If you don't care about preserving the data, just delete the"
|
||||||
|
, "directory."
|
||||||
|
, ""
|
||||||
|
, "Or, you can move it to another location, in case it turns out"
|
||||||
|
, "something in there is important."
|
||||||
|
, ""
|
||||||
|
, "Or, you can run `git annex unused` followed by `git annex dropunused`"
|
||||||
|
, "to remove data that is not used by any tag or branch, which might"
|
||||||
|
, "take care of all the data."
|
||||||
|
, ""
|
||||||
|
, "Then run `git annex uninit` again to finish."
|
||||||
|
]
|
||||||
uninitialize
|
uninitialize
|
||||||
mapM_ removeAnnex =<< getKeysPresent
|
|
||||||
liftIO $ removeDirectoryRecursive annexdir
|
|
||||||
-- avoid normal shutdown
|
-- avoid normal shutdown
|
||||||
saveState False
|
saveState False
|
||||||
inRepo $ Git.Command.run
|
inRepo $ Git.Command.run
|
||||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -6,6 +6,9 @@ git-annex (4.20130710) UNRELEASED; urgency=low
|
||||||
* Rsync.net have committed to support git-annex and offer a special
|
* Rsync.net have committed to support git-annex and offer a special
|
||||||
discounted rate for git-annex users. Updated the webapp to reflect this.
|
discounted rate for git-annex users. Updated the webapp to reflect this.
|
||||||
http://www.rsync.net/products/git-annex-pricing.html
|
http://www.rsync.net/products/git-annex-pricing.html
|
||||||
|
* uninit: Preserve .git/annex/objects at the end, if it still
|
||||||
|
has content, so that old versions of files and deleted files
|
||||||
|
are not deleted. Print a message with some suggested actions.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 09 Jul 2013 19:17:13 -0400
|
-- Joey Hess <joeyh@debian.org> Tue, 09 Jul 2013 19:17:13 -0400
|
||||||
|
|
||||||
|
|
|
@ -29,3 +29,5 @@ Ctrl-C
|
||||||
|
|
||||||
# End of transcript or log.
|
# End of transcript or log.
|
||||||
"""]]
|
"""]]
|
||||||
|
|
||||||
|
> [[done]]; see my comment --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue