Skip to contentSkip to conversation

"Already up-to-date!" merge isn't a no-op?

DISCUSSION Stephen Bash 2 participants 2 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi all-

I have a branch history that looks like this:

----------M-----M-- master
\ / /
x---------------- feature

    \             \
     x-------------A- maint

In other words we had a new feature that was "so cool" that after testing on master was back-ported to maint (luckily we knew ahead of time this was likely). When it came time to merge feature into maint the process looked something like this:

Yesterday (not shown above):

 $ git checkout master
 $ git merge maint

Today:

 $ git checkout maint
 $ git merge feature
 Merge made by the 'recursive' strategy.
 $ git checkout master
 $ git merge maint
 Already up-to-date!
 Merge made by the 'recursive' strategy.
 $ git --version
 git version 1.8.1.5

In the past, I've only seen "Already up-to-date!" when there is literally nothing to do (all commits are reachable from HEAD). In this case, the merge of feature into maint (commit A) is the only commit not reachable from HEAD, and Git does create a merge commit (though the new commit and the first parent point to the same tree). The fact that a commit is created makes me call this something more than a no-op, even though no content changed.

So what is the actual meaning of "Already up-to-date!"? Is it based on the tree, the reachable commits, or something more complicated?

Thanks,
Stephen

#2 lore raw
Quoted 3 lines · Stephen Bash

So what is the actual meaning of "Already up-to-date!"? Is it based on the tree, the reachable commits, or something more complicated?

The resulting tree of the merge happened to be the same as the original tree (i.e. "git diff HEAD^ HEAD" is empty).

This happens quite often and is perfectly normal. After merging topics that has been cooking in 'next' to 'master', merging the resulting 'master' to 'next' is likely to result in that situation, unless 'master' has gained some other changes, such as updating the draft release notes with a commit on it, or applying an obvious and trivial fix before cooking it in 'next'.