inprogress: Support --key
This commit is contained in:
parent
92c566f1b2
commit
7fd5376334
6 changed files with 44 additions and 32 deletions
17
CHANGELOG
17
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
|
* git-lfs: The url provided to initremote/enableremote will now be
|
||||||
stored in the git-annex branch, allowing enableremote to be used without
|
stored in the git-annex branch, allowing enableremote to be used without
|
||||||
an url. initremote --sameas can be used to add additional urls.
|
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.
|
* sync, assistant: Pull and push from git-lfs remotes.
|
||||||
* Fix bug that made bare repos be treated as non-bare when --git-dir
|
* Fix bug that made bare repos be treated as non-bare when --git-dir
|
||||||
was used.
|
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
|
* benchmark: Changed --databases to take a parameter specifiying the size
|
||||||
of the database to benchmark.
|
of the database to benchmark.
|
||||||
* benchmark --databases: Display size of the populated database.
|
* 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
|
* Windows: Fix handling of changes to time zone. (Used to work but was
|
||||||
broken in version 7.20181031.)
|
broken in version 7.20181031.)
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Fri, 15 Nov 2019 11:57:19 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 18 Dec 2019 13:53:51 -0400
|
||||||
|
|
||||||
git-annex (7.20191114) upstream; urgency=medium
|
git-annex (7.20191114) upstream; urgency=medium
|
||||||
|
|
||||||
|
|
|
@ -176,21 +176,26 @@ data KeyOptions
|
||||||
parseKeyOptions :: Parser KeyOptions
|
parseKeyOptions :: Parser KeyOptions
|
||||||
parseKeyOptions = parseAllOption
|
parseKeyOptions = parseAllOption
|
||||||
<|> parseBranchKeysOption
|
<|> parseBranchKeysOption
|
||||||
<|> flag' WantUnusedKeys
|
<|> parseUnusedKeysOption
|
||||||
( long "unused" <> short 'U'
|
<|> parseSpecificKeyOption
|
||||||
<> help "operate on files found by last run of git-annex unused"
|
|
||||||
)
|
parseUnusedKeysOption :: Parser KeyOptions
|
||||||
<|> (WantSpecificKey <$> option (str >>= parseKey)
|
parseUnusedKeysOption = flag' WantUnusedKeys
|
||||||
( long "key" <> metavar paramKey
|
( long "unused" <> short 'U'
|
||||||
<> help "operate on specified key"
|
<> 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 :: Parser KeyOptions
|
||||||
parseBranchKeysOption =
|
parseBranchKeysOption = WantBranchKeys <$> some (option (str >>= pure . Ref)
|
||||||
WantBranchKeys <$> some (option (str >>= pure . Ref)
|
( long "branch" <> metavar paramRef
|
||||||
( long "branch" <> metavar paramRef
|
<> help "operate on files in the specified branch or treeish"
|
||||||
<> help "operate on files in the specified branch or treeish"
|
))
|
||||||
))
|
|
||||||
|
|
||||||
parseFailedTransfersOption :: Parser KeyOptions
|
parseFailedTransfersOption :: Parser KeyOptions
|
||||||
parseFailedTransfersOption = flag' WantFailedTransfers
|
parseFailedTransfersOption = flag' WantFailedTransfers
|
||||||
|
|
|
@ -19,24 +19,24 @@ cmd = noCommit $ noMessages $ command "inprogress" SectionQuery
|
||||||
|
|
||||||
data InprogressOptions = InprogressOptions
|
data InprogressOptions = InprogressOptions
|
||||||
{ inprogressFiles :: CmdParams
|
{ inprogressFiles :: CmdParams
|
||||||
, allOption :: Bool
|
, keyOptions :: Maybe KeyOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
optParser :: CmdParamsDesc -> Parser InprogressOptions
|
optParser :: CmdParamsDesc -> Parser InprogressOptions
|
||||||
optParser desc = InprogressOptions
|
optParser desc = InprogressOptions
|
||||||
<$> cmdParams desc
|
<$> cmdParams desc
|
||||||
<*> switch
|
<*> optional (parseAllOption <|> parseSpecificKeyOption)
|
||||||
( long "all"
|
|
||||||
<> short 'A'
|
|
||||||
<> help "access all files currently being downloaded"
|
|
||||||
)
|
|
||||||
|
|
||||||
seek :: InprogressOptions -> CommandSeek
|
seek :: InprogressOptions -> CommandSeek
|
||||||
seek o = do
|
seek o = do
|
||||||
ts <- map (transferKey . fst) <$> getTransfers
|
ts <- map (transferKey . fst) <$> getTransfers
|
||||||
if allOption o
|
case keyOptions o of
|
||||||
then forM_ ts $ commandAction . start'
|
Just WantAllKeys ->
|
||||||
else do
|
forM_ ts $ commandAction . start'
|
||||||
|
Just (WantSpecificKey k)
|
||||||
|
| k `elem` ts -> commandAction (start' k)
|
||||||
|
| otherwise -> commandAction stop
|
||||||
|
_ -> do
|
||||||
let s = S.fromList ts
|
let s = S.fromList ts
|
||||||
withFilesInGit
|
withFilesInGit
|
||||||
(commandAction . (whenAnnexed (start s)))
|
(commandAction . (whenAnnexed (start s)))
|
||||||
|
|
|
@ -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
|
Rather than specifying a filename or path, this option can be
|
||||||
used to access all files that are currently being downloaded.
|
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
|
* file matching options
|
||||||
|
|
||||||
The [[git-annex-matching-options]](1)
|
The [[git-annex-matching-options]](1)
|
||||||
|
@ -47,7 +51,7 @@ some file formats can be usefully streamed in this way.
|
||||||
|
|
||||||
# EXIT STATUS
|
# 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.
|
the exit status will be 1.
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
|
@ -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 (<https://gitlab.com/chrysn/annex-to-web>, 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]]).
|
My use case is serving git-annexed files to the web from a bare repository (<https://gitlab.com/chrysn/annex-to-web>, 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)`).
|
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]]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Name: git-annex
|
Name: git-annex
|
||||||
Version: 7.20191114
|
Version: 7.20191218
|
||||||
Cabal-Version: >= 1.8
|
Cabal-Version: >= 1.8
|
||||||
License: AGPL-3
|
License: AGPL-3
|
||||||
Maintainer: Joey Hess <id@joeyh.name>
|
Maintainer: Joey Hess <id@joeyh.name>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue