rename status to info, and update docs

This commit is contained in:
Joey Hess 2013-11-07 12:45:59 -04:00
parent 4eeebf162f
commit eed2ed4fdb
8 changed files with 27 additions and 24 deletions

View file

@ -7,7 +7,7 @@
{-# LANGUAGE BangPatterns #-} {-# LANGUAGE BangPatterns #-}
module Command.Status where module Command.Info where
import "mtl" Control.Monad.State.Strict import "mtl" Control.Monad.State.Strict
import qualified Data.Map as M import qualified Data.Map as M
@ -70,31 +70,31 @@ data StatInfo = StatInfo
type StatState = StateT StatInfo Annex type StatState = StateT StatInfo Annex
def :: [Command] def :: [Command]
def = [noCommit $ command "status" paramPaths seek def = [noCommit $ command "info" paramPaths seek
SectionQuery "shows status information about the annex"] SectionQuery "shows general information about the annex"]
seek :: [CommandSeek] seek :: [CommandSeek]
seek = [withWords start] seek = [withWords start]
start :: [FilePath] -> CommandStart start :: [FilePath] -> CommandStart
start [] = do start [] = do
globalStatus globalInfo
stop stop
start ps = do start ps = do
mapM_ localStatus =<< filterM isdir ps mapM_ localInfo =<< filterM isdir ps
stop stop
where where
isdir = liftIO . catchBoolIO . (isDirectory <$$> getFileStatus) isdir = liftIO . catchBoolIO . (isDirectory <$$> getFileStatus)
globalStatus :: Annex () globalInfo :: Annex ()
globalStatus = do globalInfo = do
stats <- selStats global_fast_stats global_slow_stats stats <- selStats global_fast_stats global_slow_stats
showCustom "status" $ do showCustom "info" $ do
evalStateT (mapM_ showStat stats) (StatInfo Nothing Nothing Nothing) evalStateT (mapM_ showStat stats) (StatInfo Nothing Nothing Nothing)
return True return True
localStatus :: FilePath -> Annex () localInfo :: FilePath -> Annex ()
localStatus dir = showCustom (unwords ["status", dir]) $ do localInfo dir = showCustom (unwords ["info", dir]) $ do
stats <- selStats (tostats local_fast_stats) (tostats local_slow_stats) stats <- selStats (tostats local_fast_stats) (tostats local_slow_stats)
evalStateT (mapM_ showStat stats) =<< getLocalStatInfo dir evalStateT (mapM_ showStat stats) =<< getLocalStatInfo dir
return True return True
@ -295,7 +295,7 @@ cachedReferencedData = do
put s { referencedData = Just v } put s { referencedData = Just v }
return v return v
-- currently only available for local status -- currently only available for local info
cachedNumCopiesStats :: StatState (Maybe NumCopiesStats) cachedNumCopiesStats :: StatState (Maybe NumCopiesStats)
cachedNumCopiesStats = numCopiesStats <$> get cachedNumCopiesStats = numCopiesStats <$> get

View file

@ -46,7 +46,7 @@ import qualified Command.Whereis
import qualified Command.List import qualified Command.List
import qualified Command.Log import qualified Command.Log
import qualified Command.Merge import qualified Command.Merge
import qualified Command.Status import qualified Command.Info
import qualified Command.Migrate import qualified Command.Migrate
import qualified Command.Uninit import qualified Command.Uninit
import qualified Command.Trust import qualified Command.Trust
@ -140,7 +140,7 @@ cmds = concat
, Command.List.def , Command.List.def
, Command.Log.def , Command.Log.def
, Command.Merge.def , Command.Merge.def
, Command.Status.def , Command.Info.def
, Command.Migrate.def , Command.Migrate.def
, Command.Map.def , Command.Map.def
, Command.Direct.def , Command.Direct.def

3
debian/changelog vendored
View file

@ -6,6 +6,9 @@ git-annex (5.20131102) UNRELEASED; urgency=low
* annex.version is now set to 5 for direct mode repositories. * annex.version is now set to 5 for direct mode repositories.
This upgrade is handled fully automatically, no need to run This upgrade is handled fully automatically, no need to run
git annex upgrade git annex upgrade
* The "status" command has been renamed to "info", to allow
"git annex status" to be used in direct mode repositories, now that
"git status" won't work in them.
* The -c option now not only modifies the git configuration seen by * The -c option now not only modifies the git configuration seen by
git-annex, but it is passed along to every git command git-annex runs. git-annex, but it is passed along to every git command git-annex runs.

View file

@ -39,7 +39,7 @@ Now configure the remote and do the initial push:
git remote add origin example.com:bare-annex.git git remote add origin example.com:bare-annex.git
git push origin master git-annex git push origin master git-annex
Now `git annex status` should show the configured bare remote. If it does not, you may have to pull from the remote first (older versions of `git-annex`) Now `git annex info` should show the configured bare remote. If it does not, you may have to pull from the remote first (older versions of `git-annex`)
If you wish to configure git such that you can push/pull without arguments, set the upstream branch: If you wish to configure git such that you can push/pull without arguments, set the upstream branch:

View file

@ -607,23 +607,23 @@ subdirectories).
To generate output suitable for the gource visualisation program, To generate output suitable for the gource visualisation program,
specify `--gource`. specify `--gource`.
* `status [directory ...]` * `info [directory ...]`
Displays some statistics and other information, including how much data Displays some statistics and other information, including how much data
is in the annex and a list of all known repositories. is in the annex and a list of all known repositories.
To only show the data that can be gathered quickly, use `--fast`. To only show the data that can be gathered quickly, use `--fast`.
When a directory is specified, shows a differently formatted status When a directory is specified, shows a differently formatted info
display for that directory. In this mode, all of the file matching display for that directory. In this mode, all of the file matching
options can be used to filter the files that will be included in options can be used to filter the files that will be included in
the status. the information.
For example, suppose you want to run "git annex get .", but For example, suppose you want to run "git annex get .", but
would first like to see how much disk space that will use. would first like to see how much disk space that will use.
Then run: Then run:
git annex status --fast . --not --in here git annex info --fast . --not --in here
* `map` * `map`
@ -797,7 +797,7 @@ subdirectories).
Rather than the normal output, generate JSON. This is intended to be Rather than the normal output, generate JSON. This is intended to be
parsed by programs that use git-annex. Each line of output is a JSON parsed by programs that use git-annex. Each line of output is a JSON
object. Note that json output is only usable with some git-annex commands, object. Note that json output is only usable with some git-annex commands,
like status and find. like info and find.
* `--debug` * `--debug`
@ -1097,7 +1097,7 @@ Here are all the supported configuration settings.
up to 500000 keys. If your repository is larger than that, up to 500000 keys. If your repository is larger than that,
you can adjust this to avoid `git annex unused` not noticing some unused you can adjust this to avoid `git annex unused` not noticing some unused
data files. Increasing this will make `git-annex unused` consume more memory; data files. Increasing this will make `git-annex unused` consume more memory;
run `git annex status` for memory usage numbers. run `git annex info` for memory usage numbers.
* `annex.bloomaccuracy` * `annex.bloomaccuracy`
@ -1105,7 +1105,7 @@ Here are all the supported configuration settings.
`git annex unused`. The default accuracy is 1000 -- `git annex unused`. The default accuracy is 1000 --
1 unused file out of 1000 will be missed by `git annex unused`. Increasing 1 unused file out of 1000 will be missed by `git annex unused`. Increasing
the accuracy will make `git annex unused` consume more memory; the accuracy will make `git annex unused` consume more memory;
run `git annex status` for memory usage numbers. run `git annex info` for memory usage numbers.
* `annex.sshcaching` * `annex.sshcaching`

View file

@ -25,7 +25,7 @@ Now you can run normal annex operations, as long as the port forwarding shell is
git annex sync git annex sync
git annex get on-the-go some/big/file git annex get on-the-go some/big/file
git annex status git annex info
You can add more computers by repeating with a different port, e.g. 2202 or 2203 (or any other). You can add more computers by repeating with a different port, e.g. 2202 or 2203 (or any other).

View file

@ -31,7 +31,7 @@ On `angela`, we want to synchronise the git annex metadata with `marcos`. We nee
git init git init
git remote add marcos marcos.example.com:/srv/mp3 git remote add marcos marcos.example.com:/srv/mp3
git fetch marcos git fetch marcos
git annex status # this should display the two repos git annex info # this should display the two repos
git annex add . git annex add .
This will, again, checksum all files and add them to git annex. Once that is done, you can verify that the files are really the same as marcos with `whereis`: This will, again, checksum all files and add them to git annex. Once that is done, you can verify that the files are really the same as marcos with `whereis`:

View file

@ -4,6 +4,6 @@
subject="comment 1" subject="comment 1"
date="2013-07-12T19:36:28Z" date="2013-07-12T19:36:28Z"
content=""" content="""
Ah, I just found that git annex status can do the same :) Ah, I just found that git annex info can do the same :)
Disregard this. Disregard this.
"""]] """]]