All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: Gioele Barabucci <gioele@svario.it>, git@vger.kernel.org
Subject: Re: Git attributes ignored for root directory
Date: Wed, 12 Oct 2011 16:12:13 -0700	[thread overview]
Message-ID: <7vfwix7qk2.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4E961626.4030201@alum.mit.edu> (Michael Haggerty's message of "Thu, 13 Oct 2011 00:35:18 +0200")

Michael Haggerty <mhagger@alum.mit.edu> writes:

> On 10/05/2011 07:38 PM, Junio C Hamano wrote:
>>  - If the pattern is a single dot and nothing else, it matches everything
>>    in the current directory.
>
> This disagrees with shell usage, where "." represents a directory
> itself, not the files within a directory.

Either you misread me, or what I wrote was fuzzy, or perhaps both.

The suggested update to the list of rules very much wants a '.' to mean
the directory itself.  The problem I was solving, which turned out to be
something different from the original issue in the thread was this.

Suppose you have a directory "foo" and want to say "I want to ignore
everything in that directory". You would say "foo/" in .gitignore in the
higher level and you are happy.

How would you say the same thing if the directory to be ignored weren't
"foo" but at the top-level of the working tree? There is no such level
higher than the top-level where you can say "<the name of your project>/"
in its .gitignore file.

The best you could do is to say "./" in the .gitignore file at the
top-level directory, and the update rule you quoted is specifically
designed to address it.

Of course, you could list both ".*" and "*" in the .gitignore file at the
top-level directory for the same effect, but that works only because you
do not have to give values to the entry in .gitignore mechanism. It would
be cumbersome to duplicate two entries in .gitattributes file like that as
a workaround.

  reply	other threads:[~2011-10-12 23:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 18:52 Git attributes ignored for root directory Gioele Barabucci
2011-10-05 12:05 ` Michael Haggerty
2011-10-05 14:47   ` Gioele Barabucci
2011-10-05 17:38   ` Junio C Hamano
2011-10-05 17:56     ` Gioele Barabucci
2011-10-05 18:35       ` Junio C Hamano
2011-10-05 20:17         ` Gioele Barabucci
2011-10-05 20:25           ` Junio C Hamano
2011-10-12 22:35     ` Michael Haggerty
2011-10-12 23:12       ` Junio C Hamano [this message]
2011-10-13 10:49         ` Gioele Barabucci
2011-10-13 13:16           ` Johannes Sixt
2011-10-13 17:38           ` 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=7vfwix7qk2.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=gioele@svario.it \
    --cc=git@vger.kernel.org \
    --cc=mhagger@alum.mit.edu \
    /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.