diff options
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r-- | Command/Sync.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs index 65a025606..ddd4e0309 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -12,6 +12,7 @@ module Command.Sync ( mergeLocal, mergeRemote, commitStaged, + commitMsg, pushBranch, updateBranch, syncBranch, @@ -41,10 +42,12 @@ import qualified Command.Move import Logs.Location import Annex.Drop import Annex.UUID +import Logs.UUID import Annex.AutoMerge import Annex.Ssh import Control.Concurrent.MVar +import qualified Data.Map as M cmd :: [Command] cmd = [withOptions syncOptions $ @@ -145,8 +148,8 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) commit :: CommandStart commit = next $ next $ do - commitmessage <- fromMaybe "git-annex automatic sync" - <$> Annex.getField (optionName messageOption) + commitmessage <- maybe commitMsg return + =<< Annex.getField (optionName messageOption) showStart "commit" "" Annex.Branch.commit "update" ifM isDirect @@ -163,6 +166,12 @@ commit = next $ next $ do return True ) +commitMsg :: Annex String +commitMsg = do + u <- getUUID + m <- uuidMap + return $ "git-annex in " ++ fromMaybe "unknown" (M.lookup u m) + commitStaged :: Git.Branch.CommitMode -> String -> Annex Bool commitStaged commitmode commitmessage = go =<< inRepo Git.Branch.currentUnsafe where |