diff --git a/CHANGELOG b/CHANGELOG index c762e7ec65..d5c72041cb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,11 +1,5 @@ -git-annex (7.20191115) UNRELEASED; urgency=medium +git-annex (7.20191218) upstream; urgency=medium - * Sped up many git-annex commands that operate on many files, by - avoiding reserialization of keys. - find is 7% faster; whereis is 3% faster; and git-annex get when - all files are already present is 5% faster - * Stop displaying rsync progress, and use git-annex's own progress display - for local-to-local repo transfers. * git-lfs: The url provided to initremote/enableremote will now be stored in the git-annex branch, allowing enableremote to be used without an url. initremote --sameas can be used to add additional urls. @@ -14,6 +8,13 @@ git-annex (7.20191115) UNRELEASED; urgency=medium * sync, assistant: Pull and push from git-lfs remotes. * Fix bug that made bare repos be treated as non-bare when --git-dir was used. + * inprogress: Support --key. + * Sped up many git-annex commands that operate on many files, by + avoiding reserialization of keys. + find is 7% faster; whereis is 3% faster; and git-annex get when + all files are already present is 5% faster + * Stop displaying rsync progress, and use git-annex's own progress display + for local-to-local repo transfers. * benchmark: Changed --databases to take a parameter specifiying the size of the database to benchmark. * benchmark --databases: Display size of the populated database. @@ -22,7 +23,7 @@ git-annex (7.20191115) UNRELEASED; urgency=medium * Windows: Fix handling of changes to time zone. (Used to work but was broken in version 7.20181031.) - -- Joey Hess Fri, 15 Nov 2019 11:57:19 -0400 + -- Joey Hess Wed, 18 Dec 2019 13:53:51 -0400 git-annex (7.20191114) upstream; urgency=medium diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs index 117a876edb..da4a2adfad 100644 --- a/CmdLine/GitAnnex/Options.hs +++ b/CmdLine/GitAnnex/Options.hs @@ -176,21 +176,26 @@ data KeyOptions parseKeyOptions :: Parser KeyOptions parseKeyOptions = parseAllOption <|> parseBranchKeysOption - <|> flag' WantUnusedKeys - ( long "unused" <> short 'U' - <> help "operate on files found by last run of git-annex unused" - ) - <|> (WantSpecificKey <$> option (str >>= parseKey) - ( long "key" <> metavar paramKey - <> help "operate on specified key" - )) + <|> parseUnusedKeysOption + <|> parseSpecificKeyOption + +parseUnusedKeysOption :: Parser KeyOptions +parseUnusedKeysOption = flag' WantUnusedKeys + ( long "unused" <> short 'U' + <> help "operate on files found by last run of git-annex unused" + ) + +parseSpecificKeyOption :: Parser KeyOptions +parseSpecificKeyOption = WantSpecificKey <$> option (str >>= parseKey) + ( long "key" <> metavar paramKey + <> help "operate on specified key" + ) parseBranchKeysOption :: Parser KeyOptions -parseBranchKeysOption = - WantBranchKeys <$> some (option (str >>= pure . Ref) - ( long "branch" <> metavar paramRef - <> help "operate on files in the specified branch or treeish" - )) +parseBranchKeysOption = WantBranchKeys <$> some (option (str >>= pure . Ref) + ( long "branch" <> metavar paramRef + <> help "operate on files in the specified branch or treeish" + )) parseFailedTransfersOption :: Parser KeyOptions parseFailedTransfersOption = flag' WantFailedTransfers diff --git a/Command/Inprogress.hs b/Command/Inprogress.hs index e571fa8d3b..5238e6e115 100644 --- a/Command/Inprogress.hs +++ b/Command/Inprogress.hs @@ -19,24 +19,24 @@ cmd = noCommit $ noMessages $ command "inprogress" SectionQuery data InprogressOptions = InprogressOptions { inprogressFiles :: CmdParams - , allOption :: Bool + , keyOptions :: Maybe KeyOptions } optParser :: CmdParamsDesc -> Parser InprogressOptions optParser desc = InprogressOptions <$> cmdParams desc - <*> switch - ( long "all" - <> short 'A' - <> help "access all files currently being downloaded" - ) + <*> optional (parseAllOption <|> parseSpecificKeyOption) seek :: InprogressOptions -> CommandSeek seek o = do ts <- map (transferKey . fst) <$> getTransfers - if allOption o - then forM_ ts $ commandAction . start' - else do + case keyOptions o of + Just WantAllKeys -> + forM_ ts $ commandAction . start' + Just (WantSpecificKey k) + | k `elem` ts -> commandAction (start' k) + | otherwise -> commandAction stop + _ -> do let s = S.fromList ts withFilesInGit (commandAction . (whenAnnexed (start s))) diff --git a/doc/git-annex-inprogress.mdwn b/doc/git-annex-inprogress.mdwn index 5e5390eb2a..aa5b5d5576 100644 --- a/doc/git-annex-inprogress.mdwn +++ b/doc/git-annex-inprogress.mdwn @@ -40,6 +40,10 @@ some file formats can be usefully streamed in this way. Rather than specifying a filename or path, this option can be used to access all files that are currently being downloaded. +* `--key=keyname` + + Access the file that is currently being downloaded for the specified key. + * file matching options The [[git-annex-matching-options]](1) @@ -47,7 +51,7 @@ some file formats can be usefully streamed in this way. # EXIT STATUS -If any of the requested files are not currently being downloaded, +If any of the requested items are not currently being downloaded, the exit status will be 1. # SEE ALSO diff --git a/doc/todo/git-annex-inprogress_--key.mdwn b/doc/todo/git-annex-inprogress_--key.mdwn index f96d381e64..efb9ae6f3b 100644 --- a/doc/todo/git-annex-inprogress_--key.mdwn +++ b/doc/todo/git-annex-inprogress_--key.mdwn @@ -6,3 +6,5 @@ Please consider adding a `--key` option there, which would display the single in My use case is serving git-annexed files to the web from a bare repository (, see also [[todo/git-annex-cat]]), which would be especially useful with gitolite repositories as they are by design bare, and on devices where checkouts are cumbersome (cf. [[forum/Dealing_with_crippled_Android_file_system]]). A workaround is running `git annex inprogress --all | grep $KEY`, but that's probably relying on an implementation detail that could be changed at any time (though it probably won't as to avoid race conditions as in `tail -f $(git annex inprogress file-thats-almost.done)`). + +> [[done]] --[[Joey]] diff --git a/git-annex.cabal b/git-annex.cabal index 5d8ba73914..657f392ce9 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 7.20191114 +Version: 7.20191218 Cabal-Version: >= 1.8 License: AGPL-3 Maintainer: Joey Hess