git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tarmigan <tarmigan+git@gmail.com>
To: "Junio C Hamano" <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [RFH] cleaning up "add across symlinks"
Date: Thu, 17 Apr 2008 09:31:52 -0700	[thread overview]
Message-ID: <905315640804170931v23df8633xf51276a5858eabc7@mail.gmail.com> (raw)
In-Reply-To: <905315640804161426l442c2812k3c36c1bafe484157@mail.gmail.com>

On Wed, Apr 16, 2008 at 2:26 PM, Tarmigan <tarmigan+git@gmail.com> wrote:
> On Wed, Apr 16, 2008 at 1:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
>  > If you have this structure in your work tree:
>  >
>  >         lrwxrwxrwx a -> c
>  >         drwxrwxrwx c
>  >         -rw-rw-rw- c/b
>  >
>  >  and let million monkeys give random paths to "git-update-index --add" or
>  >  "git add", you should end up with the index with two entries, a symlink
>  >  "a" and file "c/b".
>  >
>  >  Not so.  If an unfortunate monkey says "git add a/b", we happily add it to
>  >  the index, because we notice lstat("a/b") succeeds and assume that there
>  >  is such a path.  There isn't, as far as git is concerned, because we track
>  >  symbolic links.
>
>  Thanks Junio, I'll try to do some testing with it later.

I tested with all the cases I could think of and it works for me.

>  That's almost the case I used.  The exact test to add to these,
>  without the '*' after a/, would be something like this (warning: cut
>  and paste):
>
>  +test_expect_success 'add confusion (4)' '
>  +
>  +       test_must_fail git add "a/" &&

Currently, this will succeed, so if you decide to add this case, the
test_must_fail should go.

Thanks,
Tarmigan

      reply	other threads:[~2008-04-17 16:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-16 20:53 [RFH] cleaning up "add across symlinks" Junio C Hamano
2008-04-16 21:26 ` Tarmigan
2008-04-17 16:31   ` Tarmigan [this message]

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=905315640804170931v23df8633xf51276a5858eabc7@mail.gmail.com \
    --to=tarmigan+git@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).