diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-10-15 15:28:29 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-10-15 15:36:54 -0400 |
commit | 68ac4d8240612e43bf2a5b875d527f7912b10412 (patch) | |
tree | d91fffe25ea296d87ef9f09f2733ccf7b88d6535 | |
parent | a2194926bf04d79816195d79f6549b0276414813 (diff) |
Avoid displaying network transport warning when a ssh remote does not yet have an annex.uuid set.
Instead, only display transport error if the configlist output doesn't
include an annex.uuid line, even an empty one.
A recent change made git-annex init try to get all the remote uuids, and so
the transport error would be displayed by it. It was also displayed when
eg, copying files to a remote that had no uuid yet.
4 files changed, 26 insertions, 1 deletions
diff --git a/Annex/UUID.hs b/Annex/UUID.hs index 7776b778a..cdd06c9e6 100644 --- a/Annex/UUID.hs +++ b/Annex/UUID.hs @@ -15,6 +15,7 @@ module Annex.UUID ( getUUID, getRepoUUID, getUncachedUUID, + isUUIDConfigured, prepUUID, genUUID, genUUIDInNameSpace, @@ -84,6 +85,13 @@ getUncachedUUID = toUUID . Git.Config.get key "" where (ConfigKey key) = configkey +-- Does the repo's config have a key for the UUID? +-- True even when the key has no value. +isUUIDConfigured :: Git.Repo -> Bool +isUUIDConfigured = isJust . Git.Config.getMaybe key + where + (ConfigKey key) = configkey + {- Make sure that the repo has an annex.uuid setting. -} prepUUID :: Annex () prepUUID = whenM ((==) NoUUID <$> getUUID) $ diff --git a/Remote/Git.hs b/Remote/Git.hs index 1c2573642..33eadd3d0 100644 --- a/Remote/Git.hs +++ b/Remote/Git.hs @@ -221,7 +221,7 @@ tryGitConfigRead autoinit r v <- Git.Config.fromPipe r cmd params case v of Right (r', val) -> do - when (getUncachedUUID r' == NoUUID && not (null val)) $ do + unless (isUUIDConfigured r' || null val) $ do warningIO $ "Failed to get annex.uuid configuration of repository " ++ Git.repoDescribe r warningIO $ "Instead, got: " ++ show val warningIO $ "This is unexpected; please check the network transport!" diff --git a/debian/changelog b/debian/changelog index 5be414bd1..92265fe50 100644 --- a/debian/changelog +++ b/debian/changelog @@ -42,6 +42,8 @@ git-annex (5.20150931) UNRELEASED; urgency=medium that could omit such files or otherwise be bad. Fixed by aborting the whole merge process when git merge fails for any reason other than a merge conflict. + * Avoid displaying network transport warning when a ssh remote + does not yet have an annex.uuid set. * Debian: Add torrent library to build-depends as it's packaged now, and stop recommending bittornado | bittorrent. * Debian: Remove dependency on transformers library, as it is now diff --git a/doc/forum/error_setting_up_centralized_server_on_OSX_-_failed_to_get_annex.uuid_configuration_of_repository_origin/comment_1_943ff286824bd59a164b161553d65698._comment b/doc/forum/error_setting_up_centralized_server_on_OSX_-_failed_to_get_annex.uuid_configuration_of_repository_origin/comment_1_943ff286824bd59a164b161553d65698._comment new file mode 100644 index 000000000..eed9dfda9 --- /dev/null +++ b/doc/forum/error_setting_up_centralized_server_on_OSX_-_failed_to_get_annex.uuid_configuration_of_repository_origin/comment_1_943ff286824bd59a164b161553d65698._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-10-15T18:55:42Z" + content=""" +Yeah, this is a bug, and one I was able to reproduce. It was introduced in +the last release of git-annex. + +Luckily, it's only a cosmetic bug. The `git annex init` does +succeed, and your repo is left in an ok state. If you continue +along the walkthrough path, adding some files and syncing with origin, it +will proceed to set up the origin appropriately and everything should work. + +I'm gonna fix the bug of course. Indeed, it's fixed in git master now. +"""]] |