summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-06-23 12:23:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-06-23 12:23:25 -0400
commit89fd7b34ce815fc5816de5c71f07382e30f50bd5 (patch)
tree583b948ea1409a2ecb1b41a12fe84c468acfa7b5
parent1b21dd99c58c40ddd5bce9d575a47c66f121a29c (diff)
unused command updates for branches
Now that branches are more likely, unused needs to more explicitly warn that it does not look in them.
-rw-r--r--Command/Unused.hs18
-rw-r--r--doc/git-annex.mdwn8
2 files changed, 15 insertions, 11 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 51964cc57..5744f84fd 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -54,7 +54,9 @@ checkUnused = do
where
list file msg l c = do
let unusedlist = number c l
- when (not $ null l) $ showLongNote $ msg unusedlist
+ when (not $ null l) $ do
+ showLongNote $ msg unusedlist
+ showLongNote $ "\n"
writeUnusedFile file unusedlist
return $ c + length l
@@ -108,16 +110,18 @@ staleBadMsg t = unlines $
unusedMsg :: [(Int, Key)] -> String
unusedMsg u = unusedMsg' u
- ["Some annexed data is no longer used by any files in the repository:"]
- [dropMsg Nothing]
+ ["Some annexed data is no longer used by any files in the current branch:"]
+ [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 this repository."]
+ " 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?"]
+ "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
@@ -132,7 +136,7 @@ dropMsg :: Maybe (Remote.Remote Annex) -> String
dropMsg Nothing = dropMsg' ""
dropMsg (Just r) = dropMsg' $ " --from " ++ Remote.name r
dropMsg' :: String -> String
-dropMsg' s = "(To remove unwanted data: git-annex dropunused" ++ s ++ " NUMBER)\n"
+dropMsg' s = "\nTo remove unwanted data: git-annex dropunused" ++ s ++ " NUMBER\n"
{- Finds keys whose content is present, but that do not seem to be used
- by any files in the git repo, or that are only present as bad or tmp
diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn
index 1cb079ae9..4f02db12f 100644
--- a/doc/git-annex.mdwn
+++ b/doc/git-annex.mdwn
@@ -155,13 +155,13 @@ Many git-annex commands will stage changes for later `git commit` by you.
* unused
- Checks the annex for data that does not correspond to any files currently
- in the respository, and prints a numbered list of the data.
+ 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.
To only show unused temp and bad files, specify --fast
- To check data on a remote that does not correspond to any files currently
- in the local repository, specify --from.
+ To check data on a remote that does not correspond to any files present
+ on the locally checked out branch, specify --from.
* dropunused [number ...]