diff --git a/CHANGELOG b/CHANGELOG index 4a4db3d5c3..b7f1732556 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,9 @@ git-annex (7.20190220) UNRELEASED; urgency=medium (Reversion introduced in version 7.20190122.) * Sped up git-annex export in repositories with lots of keys. * Fix cleanup of git-annex:export.log after git-annex forget --drop-dead. + * export: Deprecated the --tracking option. + Instead, users can configure remote..annex-tracking-branch + themselves. -- Joey Hess Wed, 20 Feb 2019 14:20:59 -0400 diff --git a/Command/Export.hs b/Command/Export.hs index 635b2a9dd2..50876eccd1 100644 --- a/Command/Export.hs +++ b/Command/Export.hs @@ -58,7 +58,7 @@ optParser _ = ExportOptions ) parsetracking = switch ( long "tracking" - <> help ("track changes to the " ++ paramTreeish) + <> help ("track changes to the " ++ paramTreeish ++ " (deprecated)") ) -- To handle renames which swap files, the exported file is first renamed @@ -73,7 +73,7 @@ seek o = do unlessM (isExportSupported r) $ giveup "That remote does not support exports." when (exportTracking o) $ - setConfig (remoteConfig r "export-tracking") + setConfig (remoteConfig r "annex-tracking-branch") (fromRef $ exportTreeish o) new <- fromMaybe (giveup "unknown tree") <$> -- Dereference the tree pointed to by the branch, commit, diff --git a/Command/Sync.hs b/Command/Sync.hs index 03204fe454..b14c57fc67 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -680,8 +680,8 @@ syncFile ebloom rs af k = onlyActionOn' k $ do put dest = includeCommandAction $ Command.Move.toStart' dest Command.Move.RemoveNever af k (mkActionItem af) -{- When a remote has an export-tracking branch, change the export to - - follow the current content of the branch. Otherwise, transfer any files +{- When a remote has an annex-tracking-branch configuration, change the export + - to contain the current content of the branch. Otherwise, transfer any files - that were part of an export but are not in the remote yet. - - Returns True if any file transfers were made. @@ -691,7 +691,7 @@ seekExportContent rs (currbranch, _) = or <$> forM rs go where go r = withExclusiveLock (gitAnnexExportLock (Remote.uuid r)) $ do db <- Export.openDb (Remote.uuid r) - exported <- case remoteAnnexExportTracking (Remote.gitconfig r) of + exported <- case remoteAnnexTrackingBranch (Remote.gitconfig r) of Nothing -> nontracking r Just b -> do mcur <- inRepo $ Git.Ref.tree b diff --git a/Git/Ref.hs b/Git/Ref.hs index 1986db603c..ebd171de74 100644 --- a/Git/Ref.hs +++ b/Git/Ref.hs @@ -88,9 +88,11 @@ headExists repo = do sha :: Branch -> Repo -> IO (Maybe Sha) sha branch repo = process <$> showref repo where - showref = pipeReadStrict [Param "show-ref", - Param "--hash", -- get the hash - Param $ fromRef branch] + showref = pipeReadStrict + [ Param "show-ref" + , Param "--hash" -- get the hash + , Param $ fromRef branch + ] process [] = Nothing process s = Just $ Ref $ firstLine s diff --git a/Types/GitConfig.hs b/Types/GitConfig.hs index fb2eae4570..f7500c8540 100644 --- a/Types/GitConfig.hs +++ b/Types/GitConfig.hs @@ -231,7 +231,7 @@ data RemoteGitConfig = RemoteGitConfig , remoteAnnexReadOnly :: Bool , remoteAnnexVerify :: Bool , remoteAnnexCheckUUID :: Bool - , remoteAnnexExportTracking :: Maybe Git.Ref + , remoteAnnexTrackingBranch :: Maybe Git.Ref , remoteAnnexTrustLevel :: Maybe String , remoteAnnexStartCommand :: Maybe String , remoteAnnexStopCommand :: Maybe String @@ -287,8 +287,10 @@ extractRemoteGitConfig r remotename = do , remoteAnnexReadOnly = getbool "readonly" False , remoteAnnexCheckUUID = getbool "checkuuid" True , remoteAnnexVerify = getbool "verify" True - , remoteAnnexExportTracking = Git.Ref - <$> notempty (getmaybe "export-tracking") + , remoteAnnexTrackingBranch = Git.Ref <$> + ( notempty (getmaybe "annex-tracking-branch") + <|> notempty (getmaybe "export-tracking") -- old name + ) , remoteAnnexTrustLevel = notempty $ getmaybe "trustlevel" , remoteAnnexStartCommand = notempty $ getmaybe "start-command" , remoteAnnexStopCommand = notempty $ getmaybe "stop-command"