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

2 messages from 2013-03-06 to 2013-03-06. Participants: Stephen Bash, Junio C Hamano.
Thread: https://gitlist.dev/t/33092

## Stephen Bash, 2013-03-06 21:48

Subject: "Already up-to-date!" merge isn't a no-op?
Message-ID: <142915274.2151729.1362606487755.JavaMail.root@genarts.com>
URL: https://gitlist.dev/e/142915274.2151729.1362606487755.JavaMail.root%40genarts.com
In-Reply-To: <1826064298.2151517.1362605175796.JavaMail.root@genarts.com>

```
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, 2013-03-06 22:08

Subject: Re: "Already up-to-date!" merge isn't a no-op?
Message-ID: <7v38w8p4fn.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v38w8p4fn.fsf%40alter.siamese.dyndns.org
In-Reply-To: <142915274.2151729.1362606487755.JavaMail.root@genarts.com>

```
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'.

```
