git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* correct git merge behavior or corner case?
@ 2009-04-19 22:40 Tuncer Ayaz
  2009-04-20  3:19 ` Shawn O. Pearce
  2009-04-20  9:49 ` Johannes Schindelin
  0 siblings, 2 replies; 19+ messages in thread
From: Tuncer Ayaz @ 2009-04-19 22:40 UTC (permalink / raw)
  To: git

I have stumbled upon the following blog post via one of
the news aggegrators and wondered whether the behavior
is correct and expected or he's expecting something wrong
or doing something wrong.

I cannot see a wrong usage pattern from what he has written.

http://blog.teksol.info/2009/04/15/beware-of-gits-content-tracking.html

as the author hasn't posted here after a couple of days
I decided to take his question here for at least understanding
what behavior he is experiencing.

^ permalink raw reply	[flat|nested] 19+ messages in thread
* correct git merge behavior or corner case?
@ 2009-04-20 14:50 François Beausoleil
  2009-04-21 19:27 ` Jeff King
  0 siblings, 1 reply; 19+ messages in thread
From: François Beausoleil @ 2009-04-20 14:50 UTC (permalink / raw)
  To: git

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/

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-04-21 19:29 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-19 22:40 correct git merge behavior or corner case? Tuncer Ayaz
2009-04-20  3:19 ` Shawn O. Pearce
2009-04-20  9:49 ` Johannes Schindelin
2009-04-20 10:10   ` Anders Melchiorsen
2009-04-21  2:44     ` Jeff King
2009-04-21  2:51       ` Jeff King
2009-04-21  3:09       ` Junio C Hamano
2009-04-21  8:48         ` Sverre Rabbelier
2009-04-21  8:56           ` Johannes Schindelin
2009-04-21  9:00             ` Sverre Rabbelier
2009-04-21  9:04               ` Johannes Schindelin
2009-04-21  9:01             ` Johannes Schindelin
2009-04-21 17:27               ` Michał Kiedrowicz
2009-04-21 17:54               ` Michał Kiedrowicz
2009-04-21 18:05                 ` Jeff King
2009-04-21 18:47                   ` Michał Kiedrowicz
2009-04-21 19:11                     ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2009-04-20 14:50 François Beausoleil
2009-04-21 19:27 ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).