merge: Improve commit messages to mention what was merged.

This commit is contained in:
Joey Hess 2011-11-12 14:51:19 -04:00
parent fe4ad93e4a
commit 897bf938f6
2 changed files with 15 additions and 6 deletions

View file

@ -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

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
git-annex (3.20111112) UNRELEASED; urgency=low
* merge: Improve commit messages to mention what was merged.
-- Joey Hess <joeyh@debian.org> Sat, 12 Nov 2011 14:50:21 -0400
git-annex (3.20111111) unstable; urgency=low
* Handle a case where an annexed file is moved into a gitignored directory,