summaryrefslogtreecommitdiff
path: root/Annex/Branch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-12 14:51:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-12 14:51:19 -0400
commit897bf938f687c1bd9fcfa0097b65708cf0891041 (patch)
tree48aac7bd070e05326748c3d4c0ba5960816e1bbe /Annex/Branch.hs
parentfe4ad93e4a82eabc2300705a8bfc59caaf4814b3 (diff)
merge: Improve commit messages to mention what was merged.
Diffstat (limited to 'Annex/Branch.hs')
-rw-r--r--Annex/Branch.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 05c89ed97..e86a3d7d1 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -120,8 +120,8 @@ commit message = whenM journalDirty $ lockJournal $ do
- journal into the index. Otherwise, any changes in the journal would
- later get staged, and might overwrite changes made during the merge.
-
- - It would be cleaner to handle the merge by updating the journal, not the
- - index, with changes from the branches.
+ - (It would be cleaner to handle the merge by updating the journal, not the
+ - index, with changes from the branches.)
-
- The index is always updated using a union merge, as that's the most
- efficient way to update it. However, if the branch can be
@@ -136,10 +136,13 @@ update = onceonly $ do
let (refs, branches) = unzip c
unless (not dirty && null refs) $ withIndex $ lockJournal $ do
when dirty stageJournalFiles
- unless (null branches) $ do
- showSideAction $ "merging " ++
- (unwords $ map Git.refDescribe branches) ++
+ let merge_desc = if null branches
+ then "update"
+ else "merging " ++
+ (unwords $ map Git.refDescribe branches) ++
" into " ++ name
+ unless (null branches) $ do
+ showSideAction merge_desc
{- Note: This merges the branches into the index.
- Any unstaged changes in the git-annex branch
- (if it's checked out) will be removed. So,
@@ -149,7 +152,7 @@ update = onceonly $ do
inRepo $ \g -> Git.UnionMerge.merge_index g branches
ff <- if dirty then return False else tryFastForwardTo refs
unless ff $ inRepo $
- Git.commit "update" fullname (nub $ fullname:refs)
+ Git.commit merge_desc fullname (nub $ fullname:refs)
invalidateCache
where
onceonly a = unlessM (branchUpdated <$> getState) $ do