From: David Kastrup <dak@gnu.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] checkout_entry: only try to create directories when no file existed there
Date: Wed, 08 Aug 2007 23:27:53 +0200 [thread overview]
Message-ID: <85y7glpvhi.fsf@lola.goethe.zz> (raw)
In-Reply-To: <Pine.LNX.4.64.0708082200240.14781@racer.site> (Johannes Schindelin's message of "Wed\, 8 Aug 2007 22\:00\:53 +0100 \(BST\)")
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> It is obvious that we do not have to create directories when the file we
> want to check out already existed.
>
> Besides, it fixes the obscure use case, where you want to track a
> file which is _outside_ of your working tree, by creating a symbolic
> link to the directory it lives in, and adding the file with
> something like "git add symlink/file". Without this patch, "git
> checkout symlink/file" would actually _replace_ "symlink" by a
> directory of the same name.
Uh, when git is tracking symlinks (and it does by default), this is
quite the correct thing to do. Of course, it should rather barf with
a merge conflict. But it has no business following links and doing
potential damage either outside or inside of the work tree, by
confusing the target of a link with the link itself. For example, I
can easily relocate a complete git work tree with "mv" in the
directory hierarchy. Should an update/commit/whatever then start
wreaking havoc in places that incidentally don't point to the same
location anymore?
My vote here is emphatically "no". Just maintain the links, not
whatever they point to.
I can think of only a single reasonable exception: if the symlink
itself is _not_ registered (because is has been explicitly entered
into a .gitignore file or never added for other reasons), but its
target _has_ been added explicitly _dereferencing_ the symlink. This
difference can only occur with directory symlinks since file symlinks
can't be distinguished in this manner from the name of the link
itself.
It would be good if somebody brought this to Johannes' attention, even
if just replying with a quotation: he chose to killfile me.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
prev parent reply other threads:[~2007-08-08 21:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 21:00 [PATCH] checkout_entry: only try to create directories when no file existed there Johannes Schindelin
2007-08-08 21:17 ` Junio C Hamano
2007-08-08 21:42 ` Johannes Schindelin
2007-08-08 22:40 ` Junio C Hamano
2007-08-08 22:54 ` Johannes Schindelin
2007-08-08 21:27 ` David Kastrup [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=85y7glpvhi.fsf@lola.goethe.zz \
--to=dak@gnu.org \
--cc=Johannes.Schindelin@gmx.de \
--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