git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: jidanni@jidanni.org
Cc: git@vger.kernel.org, joey@kitenet.net
Subject: Re: negated list in .gitignore no fun
Date: Thu, 18 Dec 2008 14:54:18 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0812181452030.14014@localhost.localdomain> (raw)
In-Reply-To: <alpine.LFD.2.00.0812181429100.14014@localhost.localdomain>



On Thu, 18 Dec 2008, Linus Torvalds wrote:
> 
> So you have several possibilities:
> 
>  (a) either create a .gitignore that looks like this:
> 
> 	*
> 	!X11
> 	!X11/xorg.conf
> 	!anacrontab
> 	!apt
> 	!apt/apt.conf.d
> 	!apt/apt.conf.d/10jidanni
> 	!apt/sources.list
> 
>     which should work around it by telling git that it shouldn't ignore 
>     the subdirectories.

Oh, you should have a '/' there in the subdirectory marker too, because 
otherwise a file like 'X11/apt' would now match as a positive match.

>  (c) Try to teach git to not ignore subdirectories leading up to 
>      non-ignored files, and give you the .gitignore semantics you like. I 
>      suspect it's not worth it, because the git behaviour is logical once 
>      you know about it and understand it.

.. and because of subtle issues like this - negated entries are really 
quite complex enough as-is. Don't use them for anything subtle, you _will_ 
get them wrong regardless.

			Linus

      reply	other threads:[~2008-12-18 22:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-18 21:53 negated list in .gitignore no fun jidanni
2008-12-18 22:34 ` Boyd Stephen Smith Jr.
2008-12-18 22:38 ` Linus Torvalds
2008-12-18 22:54   ` Linus Torvalds [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=alpine.LFD.2.00.0812181452030.14014@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=jidanni@jidanni.org \
    --cc=joey@kitenet.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 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).