All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Johannes Sixt <j.sixt@viscovery.net>, git@vger.kernel.org
Subject: Re: [PATCH 1/4] is_directory(): a generic helper function
Date: Tue, 09 Sep 2008 07:51:06 -0700	[thread overview]
Message-ID: <7vprnd8jad.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20080909123207.GA25799@coredump.intra.peff.net> (Jeff King's message of "Tue, 9 Sep 2008 08:32:07 -0400")

Jeff King <peff@peff.net> writes:

> On Tue, Sep 09, 2008 at 12:31:39PM +0200, Johannes Sixt wrote:
>
>> Junio C Hamano schrieb:
>> > +/*
>> > + * Do not use this for inspecting *tracked* content.  When path is a
>> > + * symlink to a directory, we do not want to say it is a directory.
>> 
>> I though stat(2) checks the thing that a symlink points to. Then either
>> this comment is not correct or you want to use lstat(2), no?
>
> I assume he meant "do not use this for tracked content, because in that
> case...". But I had to read it twice to make sense.

Sorry, I can't type, but you assumed correctly.  When we are tracking a
path "a/b" where "b" is a submodule, we want to notice the change made by
the user to rmdir "a/b" and replace it with a symbolic link that points
elsewhere, so we shouldn't be using is_directory() in such a codepath.
Worse yet, we also want to catch the case where you "rm -fr a" and make a
symlink that points at a directory that may (or may not) have a
subdirectory "b".  If we were tracking "a/b", then we have to say that the
directory "a/b" does not exist anymore.  It shows that is_directory() is a
wrong function to use while inspecting the tracked content (aka worktree).

      reply	other threads:[~2008-09-09 14:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  8:27 [PATCH 0/4] Pushing into a repository with alternates Junio C Hamano
2008-09-09  8:27 ` [PATCH 1/4] is_directory(): a generic helper function Junio C Hamano
2008-09-09  8:27   ` [PATCH 2/4] receive-pack: make it a builtin Junio C Hamano
2008-09-09  8:27     ` [PATCH 3/4] push: prepare sender to receive extended ref information from the receiver Junio C Hamano
2008-09-09  8:27       ` [PATCH 4/4] push: receiver end advertises refs from alternate repositories Junio C Hamano
2008-09-09 13:03       ` [PATCH 3/4] push: prepare sender to receive extended ref information from the receiver Jeff King
2008-09-09  9:26     ` [PATCH 2/4] receive-pack: make it a builtin Paolo Bonzini
2008-09-09 14:24       ` Junio C Hamano
2008-09-09 14:47         ` Paolo Bonzini
2008-09-09 10:31   ` [PATCH 1/4] is_directory(): a generic helper function Johannes Sixt
2008-09-09 12:32     ` Jeff King
2008-09-09 14:51       ` Junio C Hamano [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=7vprnd8jad.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.