git-annex/Command/Merge.hs
Joey Hess 94351daba6
configuration to disable automatic merge conflict resolution
* Added annex.resolvemerge configuration, which can be set to false to
  disable the usual automatic merge conflict resolution done by git-annex
  sync and the assistant.
* sync: Added --no-resolvemerge option.

Note that disabling merge conflict resolution is probably not a good idea
in a direct mode repo or adjusted branch. Since updates to both are done
outside the usual work tree, if it fails the tree is not left in a
conflicted state, and it would be hard to manually resolve the conflict.
Still, made annex.resolvemerge be supported in those cases for consistency.

This commit was sponsored by Riku Voipio.
2017-06-01 12:51:01 -04:00

36 lines
844 B
Haskell

{- git-annex command
-
- Copyright 2011, 2013 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Merge where
import Command
import qualified Annex.Branch
import Command.Sync (prepMerge, mergeLocal, getCurrBranch, mergeConfig)
cmd :: Command
cmd = command "merge" SectionMaintenance
"automatically merge changes from remotes"
paramNothing (withParams seek)
seek :: CmdParams -> CommandSeek
seek _ = do
commandAction mergeBranch
commandAction mergeSynced
mergeBranch :: CommandStart
mergeBranch = do
showStart "merge" "git-annex"
next $ do
Annex.Branch.update
-- commit explicitly, in case no remote branches were merged
Annex.Branch.commit "update"
next $ return True
mergeSynced :: CommandStart
mergeSynced = do
prepMerge
mergeLocal mergeConfig def =<< join getCurrBranch