documentation/warning message update for future feature

This commit is contained in:
Joey Hess 2011-09-23 18:04:38 -04:00
parent 6dc23b889e
commit d75da353b9
4 changed files with 15 additions and 24 deletions

View file

@ -112,21 +112,8 @@ staleBadMsg t = unlines $
unusedMsg :: [(Int, Key)] -> String unusedMsg :: [(Int, Key)] -> String
unusedMsg u = unusedMsg' u unusedMsg u = unusedMsg' u
["Some annexed data is no longer used by any files in the current branch:"] ["Some annexed data is no longer used by any files:"]
[dropMsg Nothing, [dropMsg Nothing]
"Please be cautious -- are you sure that another branch, or another",
"repository does not still use this data?"]
remoteUnusedMsg :: Remote.Remote Annex -> [(Int, Key)] -> String
remoteUnusedMsg r u = unusedMsg' u
["Some annexed data on " ++ name ++
" is not used by any files in the current branch:"]
[dropMsg $ Just r,
"Please be cautious -- Are you sure that the remote repository",
"does not use this data? Or that it's not used by another branch?"]
where
name = Remote.name r
unusedMsg' :: [(Int, Key)] -> [String] -> [String] -> String unusedMsg' :: [(Int, Key)] -> [String] -> [String] -> String
unusedMsg' u header trailer = unlines $ unusedMsg' u header trailer = unlines $
header ++ header ++
@ -134,6 +121,13 @@ unusedMsg' u header trailer = unlines $
["(To see where data was previously used, try: git log --stat -S'KEY')"] ++ ["(To see where data was previously used, try: git log --stat -S'KEY')"] ++
trailer trailer
remoteUnusedMsg :: Remote.Remote Annex -> [(Int, Key)] -> String
remoteUnusedMsg r u = unusedMsg' u
["Some annexed data on " ++ name ++ " is not used by any files:"]
[dropMsg $ Just r]
where
name = Remote.name r
dropMsg :: Maybe (Remote.Remote Annex) -> String dropMsg :: Maybe (Remote.Remote Annex) -> String
dropMsg Nothing = dropMsg' "" dropMsg Nothing = dropMsg' ""
dropMsg (Just r) = dropMsg' $ " --from " ++ Remote.name r dropMsg (Just r) = dropMsg' $ " --from " ++ Remote.name r

4
debian/changelog vendored
View file

@ -13,6 +13,10 @@ git-annex (3.20110916) UNRELEASED; urgency=low
* Note that this is a behavior change for git-annex find! Old behavior * Note that this is a behavior change for git-annex find! Old behavior
can be gotten by using: git-annex find --in . can be gotten by using: git-annex find --in .
* status: Massively sped up; remove --fast mode. * status: Massively sped up; remove --fast mode.
* unused: File contents used by branches and tags are no longer
considered unused, even when not used by the current branch. This is
the final piece of the puzzle needed for git-annex to to play nicely
with branches.
-- Joey Hess <joeyh@debian.org> Sun, 18 Sep 2011 18:25:51 -0400 -- Joey Hess <joeyh@debian.org> Sun, 18 Sep 2011 18:25:51 -0400

View file

@ -182,12 +182,11 @@ subdirectories).
* unused * unused
Checks the annex for data that does not correspond to any files present Checks the annex for data that does not correspond to any files present
in the currently checked out branch, and prints a numbered list of the data. in any tar or branch, and prints a numbered list of the data.
To only show unused temp and bad files, specify --fast To only show unused temp and bad files, specify --fast
To check data on a remote that does not correspond to any files present To check for annexed data on a remote, specify --from.
on the locally checked out branch, specify --from.
* dropunused [number ...] * dropunused [number ...]

View file

@ -29,11 +29,5 @@ on special remotes, instead use `git annex unused --from`. Example:
1 WORM-s3-m1301674316--foo 1 WORM-s3-m1301674316--foo
(To see where data was previously used, try: git log --stat -S'KEY') (To see where data was previously used, try: git log --stat -S'KEY')
(To remove unwanted data: git-annex dropunused --from mys3 NUMBER) (To remove unwanted data: git-annex dropunused --from mys3 NUMBER)
Please be cautious -- are you sure that the remote repository
does not use this data?
$ git annex dropunused --from mys3 1 $ git annex dropunused --from mys3 1
dropunused 12948 (from mys3...) ok dropunused 12948 (from mys3...) ok
Do be cautious when using this; it cannot detect if content in a remote
is used by that remote, or is the last copy of data that is used by
some *other* remote.