git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: "Pickens, James E" <james.e.pickens@intel.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Kjetil Barvik <barvik@broadpark.no>,
	Michael J Gruber <git@drmicha.warpmail.net>
Subject: Re: [PATCH v3] Demonstrate bugs when a directory is replaced with a symlink
Date: Wed, 29 Jul 2009 18:06:39 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.01.0907291758030.3161@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.01.0907291656420.3161@localhost.localdomain>



On Wed, 29 Jul 2009, Linus Torvalds wrote:
> 
> Hmm... This looks like it should do it.
> 
> It doesn't make the test _pass_ (we don't seem to be creating a/b-2/c/d 
> properly - I haven't checked why yet, but I suspect it is becasue we think 
> it already exists due to the symlinked version lstat'ing fine), but it 
> seems to do the right thing.

Never mind. The patch does what I set out to do, but it's not relevant for 
the problem.

What happens is:

 - we remove a/b/c/d to make room for the a/b symlink:

	merge_trees ->
	  git_merge_trees ->
	    check_updates ->
	      checkout_entry ->
	        remove_subtree("a/b") ->
	          recursive rm

   This is correct

 - then we create the a/b symlink to a/b2

	merge_trees ->
	  git_merge_trees ->
	    check_updates ->
	      checkout_entry ->
	        write_entry ->
	          symlink

   This is correct

 - Then we remove 'a/b/c/d' again for the 'unmerged_cache()' case:

	merge_trees ->
	  process_entry ->
	    remove_file

   because th eprocess_entry() will decide that the original tree had that 
   "a/b/c/d" file (true) that needs to be removed (false - we already 
   did that as part of creating "a/b").

Annoying.

		Linus

  reply	other threads:[~2009-07-30  1:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 22:13 More symlink/directory troubles James Pickens
2009-07-28 22:13 ` [PATCH 1/2] Demonstrate bugs when a directory is replaced with a symlink James Pickens
2009-07-28 22:13   ` [PATCH 2/2] Demonstrate merge failure " James Pickens
2009-07-29  8:29     ` Michael J Gruber
2009-07-29 16:39       ` Pickens, James E
2009-07-29  8:19   ` [PATCH 1/2] Demonstrate bugs " Michael J Gruber
2009-07-29  8:33     ` Junio C Hamano
2009-07-29 16:57       ` Pickens, James E
2009-07-29 17:48       ` [PATCH v2] " Pickens, James E
2009-07-29 18:31         ` Junio C Hamano
2009-07-29 21:02           ` [PATCH v3] " Pickens, James E
2009-07-29 22:08             ` Linus Torvalds
2009-07-29 22:44               ` Junio C Hamano
2009-07-29 23:01               ` Kjetil Barvik
2009-07-29 23:58               ` Linus Torvalds
2009-07-30  1:06                 ` Linus Torvalds [this message]
2009-07-30  3:26               ` Junio C Hamano
2009-07-30  6:05               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.01.0907291758030.3161@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=barvik@broadpark.no \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=james.e.pickens@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).