# correct git merge behavior or corner case?

2 messages from 2009-04-20 to 2009-04-21. Participants: François Beausoleil, Jeff King.
Thread: https://gitlist.dev/t/18967

## François Beausoleil, 2009-04-20 14:50

Subject: correct git merge behavior or corner case?
Message-ID: <2FE32A75-C0D9-4156-B5D2-61AC6C086E5F@teksol.info>
URL: https://gitlist.dev/e/2FE32A75-C0D9-4156-B5D2-61AC6C086E5F%40teksol.info

```
Hi all,

I'm the author of http://blog.teksol.info/2009/04/15/beware-of-gits-content-tracking.html

In http://article.gmane.org/gmane.comp.version-control.git/116954,  
Johannes was very critical of me, so here's the full story.

I cloned the repository and branched master to do some integration  
work.  On the integration branch, I created an empty file.  At one  
point, I merged from master and had some conflicts.  While resolving  
the conflicts, I happened to notice a file that didn't exist on master  
had been modified.

Full transcript follows:

$ git checkout -b merge-tracking-reproduce  
5b8520419833635c61bdfb9abbbdc086df512388 # integration branch
$ git merge 5ed60ecabd585972003084e07401f598d00f5a1d # master branch

$ git status
# On branch merge-tracking-reproduce
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
...
#       modified:   vendor/plugins/acts_as_money/LICENSE
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
... a couple of conflicts, they don't matter

$ git diff --cached vendor/plugins/acts_as_money/LICENSE
diff --git a/vendor/plugins/acts_as_money/LICENSE b/vendor/plugins/ 
acts_as_money/LICENSE
index e69de29..a273c73 100644
--- a/vendor/plugins/acts_as_money/LICENSE
+++ b/vendor/plugins/acts_as_money/LICENSE
@@ -0,0 +1,4 @@
+one:
+  user: active
+  name: name
+  description: description

$ git log 5b8520419833635c61bdfb9abbbdc086df512388 -- vendor/plugins/ 
acts_as_money/LICENSE # on integration branch
commit c25787637b6ac5d8f0783cf1688c9ce6fb135659
Author: François Beausoleil <francois@teksol.info>
Date:   Thu Apr 9 14:15:03 2009 -0400

     Added Quirky dependencies

$ git log 5ed60ecabd585972003084e07401f598d00f5a1d -- vendor/plugins/ 
acts_as_money/LICENSE # on master branch
# empty, no file by that name on master

$ git log "-Sdescription: description"  
5b8520419833635c61bdfb9abbbdc086df512388 # on integration branch

$ git log "-Sdescription: description"  
5ed60ecabd585972003084e07401f598d00f5a1d # on master branch
commit 36d2a29d0c3c3a2a51db5f3be9faea7cea7ff3c1
Author: Michael Lacy <mike@kluster.com>
Date:   Tue Apr 14 10:16:50 2009 -0400

     quirky voting

$ git diff 36d2a29d0c3c3a2a51db5f3be9faea7cea7ff3c1^.. 
36d2a29d0c3c3a2a51db5f3be9faea7cea7ff3c1 -- vendor/gems/thoughtbot- 
shoulda-2.10.1/test/fixtures/products.yml
diff --git a/vendor/gems/thoughtbot-shoulda-2.10.1/test/fixtures/ 
products.yml b/vendor/gems/thoughtbot-shoulda-2.10.1/test/fixtures/
index e69de29..a273c73 100644
--- a/vendor/gems/thoughtbot-shoulda-2.10.1/test/fixtures/products.yml
+++ b/vendor/gems/thoughtbot-shoulda-2.10.1/test/fixtures/products.yml
@@ -0,0 +1,4 @@
+one:
+  user: active
+  name: name
+  description: description

Regarding Anders reproduction recipe, no file was deleted.  I'm trying  
to write a reproduction script, but haven't managed to reproduce it  
just yet.  The steps I *think* happened are thus:

cd $(mktemp -d repo.XXXXXX)
git init
touch README
git add README
git commit --message "First commit"
git checkout -b integration
mkdir -p vendor/a
touch vendor/a/LICENSE
git add vendor/a/LICENSE
git commit --message "Adding LICENSE"
git checkout master
mkdir -p vendor/b
touch vendor/b/COPYING
git add vendor/b/COPYING
git commit --message "Adding COPYING"
echo "adding some content" > vendor/b/COPYING
git commit --all --message "Updated COPYING"
git checkout integration
git merge master
git diff HEAD^..HEAD

But the bug isn't reproduced with these steps.  If you want access to  
the repository, please contact me privately and I'll give you access.

Johannes, you were right: I should have found the right avenue for  
posting this question and done so.  If not immediately, at least the  
next day.  It was late, I had other things to do, I just decided to  
post a quick note.  Call me lazy, yes.  Incompetent, that's going a  
bit too far.  I hope my competence can be redeemed in your eyes.

Have a nice day!
--
François Beausoleil
http://blog.teksol.info/
http://piston.rubyforge.org/

```

## Jeff King, 2009-04-21 19:27

Subject: Re: correct git merge behavior or corner case?
Message-ID: <20090421192718.GA7832@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090421192718.GA7832%40coredump.intra.peff.net
In-Reply-To: <2FE32A75-C0D9-4156-B5D2-61AC6C086E5F@teksol.info>

```
On Mon, Apr 20, 2009 at 10:50:25AM -0400, François Beausoleil wrote:

> Regarding Anders reproduction recipe, no file was deleted.  I'm trying to 
> write a reproduction script, but haven't managed to reproduce it just yet. 
>  The steps I *think* happened are thus:

If there is no deletion, then that seems like it might actually be a
bug.

> But the bug isn't reproduced with these steps.  If you want access to the 
> repository, please contact me privately and I'll give you access.

I can take a look at it if you want to mail me the details off-list.

> Johannes, you were right: I should have found the right avenue for  
> posting this question and done so.  If not immediately, at least the next 
> day.  It was late, I had other things to do, I just decided to post a 
> quick note.  Call me lazy, yes.  Incompetent, that's going a bit too far.  
> I hope my competence can be redeemed in your eyes.

I think it is OK to complain about and discuss git on your blog. That's
what it's there for. But I do think you are much more likely to get
developer attention and get your problem _fixed_ if you send a message
to the mailing list. So I don't think posting on a blog makes you
incompetent; but complaining afterwards that git developers didn't read
your blog and fix your problem might. ;)

-Peff

```
