avoid unncessary version output differences in different contexts
Show operating system and repository version list when run outside a git repo too. Also made it only display the local repository version when in a git-annex repo. Before it showed "unknown" when run in a git repo that was not git-annex initialized. That seemed like confusing behavior. This commit was sponsored by Jochen Bartl on Patreon.
This commit is contained in:
parent
95f7295b67
commit
2e6a6024c2
4 changed files with 19 additions and 10 deletions
|
@ -1,6 +1,8 @@
|
||||||
git-annex (6.20180530) UNRELEASED; urgency=medium
|
git-annex (6.20180530) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* Fix build with ghc 8.4+, which broke due to the Semigroup Monoid change.
|
* Fix build with ghc 8.4+, which broke due to the Semigroup Monoid change.
|
||||||
|
* version: Show operating system and repository version list
|
||||||
|
when run outside a git repo too.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 30 May 2018 11:49:08 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 30 May 2018 11:49:08 -0400
|
||||||
|
|
||||||
|
|
|
@ -48,16 +48,9 @@ seekNoRepo o
|
||||||
|
|
||||||
showVersion :: Annex ()
|
showVersion :: Annex ()
|
||||||
showVersion = do
|
showVersion = do
|
||||||
v <- getVersion
|
liftIO showPackageVersion
|
||||||
liftIO $ do
|
maybe noop (liftIO . vinfo "local repository version")
|
||||||
showPackageVersion
|
=<< getVersion
|
||||||
vinfo "local repository version" $ fromMaybe "unknown" v
|
|
||||||
vinfo "supported repository versions" $
|
|
||||||
unwords supportedVersions
|
|
||||||
vinfo "upgrade supported from repository versions" $
|
|
||||||
unwords upgradableVersions
|
|
||||||
vinfo "operating system" $
|
|
||||||
unwords [os, arch]
|
|
||||||
|
|
||||||
showPackageVersion :: IO ()
|
showPackageVersion :: IO ()
|
||||||
showPackageVersion = do
|
showPackageVersion = do
|
||||||
|
@ -67,6 +60,11 @@ showPackageVersion = do
|
||||||
vinfo "key/value backends" $ unwords $
|
vinfo "key/value backends" $ unwords $
|
||||||
map (formatKeyVariety . B.backendVariety) Backend.list
|
map (formatKeyVariety . B.backendVariety) Backend.list
|
||||||
vinfo "remote types" $ unwords $ map R.typename Remote.remoteTypes
|
vinfo "remote types" $ unwords $ map R.typename Remote.remoteTypes
|
||||||
|
vinfo "operating system" $ unwords [os, arch]
|
||||||
|
vinfo "supported repository versions" $
|
||||||
|
unwords supportedVersions
|
||||||
|
vinfo "upgrade supported from repository versions" $
|
||||||
|
unwords upgradableVersions
|
||||||
|
|
||||||
showRawVersion :: IO ()
|
showRawVersion :: IO ()
|
||||||
showRawVersion = do
|
showRawVersion = do
|
||||||
|
|
|
@ -45,3 +45,5 @@ It might make sense to also always output "supported repository versions" and "u
|
||||||
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
|
||||||
|
|
||||||
I am a long time happy user of git-annex. Thank you for your never ending effort!
|
I am a long time happy user of git-annex. Thank you for your never ending effort!
|
||||||
|
|
||||||
|
> [[done]] --[[Joey]]
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 1"""
|
||||||
|
date="2018-06-04T16:16:39Z"
|
||||||
|
content="""
|
||||||
|
Good catch.
|
||||||
|
"""]]
|
Loading…
Reference in a new issue