Re: negated list in .gitignore no fun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux