git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] fsck: warn about ".git" in trees
Date: Tue, 04 Dec 2012 11:40:06 +0100	[thread overview]
Message-ID: <50BDD306.30301@op5.se> (raw)
In-Reply-To: <50B90E11.8090501@web.de>

On 11/30/2012 08:50 PM, Torsten Bögershausen wrote:
>> Having a ".git" entry inside a tree can cause confusing
>> results on checkout. At the top-level, you could not
>> checkout such a tree, as it would complain about overwriting
>> the real ".git" directory. In a subdirectory, you might
>> check it out, but performing operations in the subdirectory
>> would confusingly consider the in-tree ".git" directory as
>> the repository.
> [snip]
>> +    int has_dotgit = 0;
> 
> Name like "." or ".." are handled as directories by the OS.
> 

The patch is for the index, where they're handled as whatever the mode
claims it is. The patch doesn't touch those parts though.

> ".git" could be a file or a directory, at least in theory,
> and from the OS point of view,
> but we want to have this as a reserved name.
> 
> Looking at bad directory names, which gives trouble when checking out:
> 
> Should we check for "/" or "../blabla" as well?
> 

Apart from the checks already in place, checking for git's internal
directory separator marker (which is '/') is enough to catch both,
and that check is done.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

      parent reply	other threads:[~2012-12-04 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28 21:35 [PATCH] fsck: warn about ".git" in trees Jeff King
2012-11-30 19:50 ` Torsten Bögershausen
2012-11-30 19:55   ` Jeff King
2012-12-04 10:40   ` Andreas Ericsson [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=50BDD306.30301@op5.se \
    --to=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=tboegi@web.de \
    /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).