threads / discuss / 33092

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

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

## tl;dr

2 messages between Mar 6, 2013 and Mar 6, 2013.

replies: 1people: 2as markdown or json

Stephen Bash· Mar 6, 2013, 21:48 UTC · lore
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

Junio C Hamano· Mar 6, 2013, 22:08 UTC · re: Stephen Bash · lore

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

Stephen Bash <bash@genarts.com> writes:
> 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'.

← back to recent threads