dropunused behavior change: Now refuses to drop the last copy of a file, unless you use the --force.

This was the last place in git-annex that could remove data referred to by
the git history, without being forced.

Like drop, dropunused checks remotes, and honors the global annex.numcopies
setting. (However, .gitattributes settings cannot apply to unused files.)
This commit is contained in:
Joey Hess 2013-07-25 19:39:44 -04:00
parent b80ec22056
commit 822918089e
4 changed files with 11 additions and 5 deletions

View file

@ -32,9 +32,8 @@ perform key = maybe droplocal dropremote =<< Remote.byNameWithUUID =<< from
where where
dropremote r = do dropremote r = do
showAction $ "from " ++ Remote.name r showAction $ "from " ++ Remote.name r
ok <- Remote.removeKey r key Command.Drop.performRemote key Nothing r
next $ Command.Drop.cleanupRemote key r ok droplocal = Command.Drop.performLocal key Nothing Nothing
droplocal = Command.Drop.performLocal key (Just 0) Nothing -- force drop
from = Annex.getField $ Option.name Command.Drop.fromOption from = Annex.getField $ Option.name Command.Drop.fromOption
performOther :: (Key -> Git.Repo -> FilePath) -> Key -> CommandPerform performOther :: (Key -> Git.Repo -> FilePath) -> Key -> CommandPerform

7
debian/changelog vendored
View file

@ -1,5 +1,12 @@
git-annex (4.20130724) UNRELEASED; urgency=low git-annex (4.20130724) UNRELEASED; urgency=low
* dropunused behavior change: Now refuses to drop the last copy of a
file, unless you use the --force.
This was the last place in git-annex that could remove data referred
to by the git history, without being forced.
Like drop, dropunused checks remotes, and honors the global
annex.numcopies setting. (However, .gitattributes settings cannot
apply to unused files.)
* Add status message to XMPP presence tag, to identify to others that * Add status message to XMPP presence tag, to identify to others that
the client is a git-annex client. Closes: #717652 the client is a git-annex client. Closes: #717652
* webapp: When creating a repository on a removable drive, set * webapp: When creating a repository on a removable drive, set

View file

@ -35,7 +35,7 @@ To stop using direct mode:
With direct mode, you're operating without large swathes of git-annex's With direct mode, you're operating without large swathes of git-annex's
carefully constructed safety net, which ensures that past versions of carefully constructed safety net, which ensures that past versions of
files are preserved and can be accessed (until you dropunused them). files are preserved and can be accessed.
With direct mode, any file can be edited directly, or deleted at any time, With direct mode, any file can be edited directly, or deleted at any time,
and there's no guarantee that the old version is backed up somewhere else. and there's no guarantee that the old version is backed up somewhere else.

View file

@ -19,7 +19,7 @@ preserving it. So from time to time, you may want to check for such data:
After running `git annex unused`, you can follow the instructions to examine After running `git annex unused`, you can follow the instructions to examine
the history of files that used the data, and if you decide you don't need that the history of files that used the data, and if you decide you don't need that
data anymore, you can easily remove it: data anymore, you can easily remove it from your local repository.
# git annex dropunused 1 # git annex dropunused 1
dropunused 1 ok dropunused 1 ok