0

So, recently I wanted to see what would happen if I merged two branches in git. I found this answer which suggests:

git merge --no-commit --no-ff $BRANCH

That told me that I have no changes between the branches. I thought this was reasonable (I knew that someone had merged them recently), but then when I used diff, I got results back. Here's the full output:

html 15:53:26 >> git merge --no-commit --no-ff dev_1_1
Already up-to-date.
html 15:54:33 >> git merge --no-commit --no-ff origin/dev_1_1
Already up-to-date.
html 15:54:40 >> git diff dev_1_1
diff --git a/html/sites/all/modules/client/client_feed/client_feed.module b/html/sites/all/modules/client/client_feed/client_feed.module
index 840deb8..fb88b96 100644
--- a/html/sites/all/modules/client/client_feed/client_feed.module
+++ b/html/sites/all/modules/client/client_feed/client_feed.module
@@ -743,7 +743,7 @@ function client_client_variable_info($options) {
     'default' => 'production',
     'description' => t('"development" or "production" (QA should be development)', array(), $options),
   );
-       
+
+
+/**
+ * Implements function for return select list with items.
+ *
+ * @param int $id
+ *   Taxonomy term id (tid).
+ *
+ * @return array $items
+ *   Array with items.
+ */
Community
  • 1
  • 1
cwallenpoole
  • 79,954
  • 26
  • 128
  • 166

1 Answers1

0

So, it turns out that the reason this came up was because the merge was from the wrong branch. If you have two branches which are starting at the same spot:

A   B
|   |
|   + Commit extra code
|   |

This will happen:

git checkout B
git merge --no-commit --no-ff A
# Already up to date
git diff A
# Everything from the extra commit
cwallenpoole
  • 79,954
  • 26
  • 128
  • 166
  • Indeed. "Up to date" doesn't mean "no changes between the branches", it means that the target is already reachable by HEAD. There's nothing to merge *in*, but HEAD may be ahead of the target. – Edward Thomson Mar 20 '14 at 20:38
  • @EdwardThomson Yea... wish I had realized it sooner. – cwallenpoole Mar 20 '14 at 21:18