Re: Change in .gitignore handling: intended or bug?

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

 



On Thu, Mar 03, 2016 at 09:11:56PM -0500, Charles Strahan wrote:
> Hello,
> 
> I've found a change in the way .gitignore works, and I'm not sure if
> it's a bug
> or intended.
> 
> Previously, one could use the following .gitignore:
> 
>     *
>     !/foo
>     !/foo/bar.txt
>     !/baz
>     !/baz/quux
>     !/baz/quux/**/*
> 
> And these files would be seen by git:
> 
>     foo/bar.txt
>     baz/quux/grault.txt
>     baz/quux/corge/wibble.txt
> 
> And these files would be ignored:
> 
>     foo/garply.txt
>     baz/waldo.txt
> 
> At some point (between git 2.6.0 and 2.7.0, I think), the behavior
> changed such
> that _none_ of the files above would be ignored. Previously, git would
> treat
> !/foo as an indication that it should not prune /foo, but that
> _wouldn't_ be
> sufficient to un-ignore the contents thereof. Now, it seems the new
> scheme
> treats !/foo as functionally equivalent to !/foo followed by !/foo/**/*
> in the
> old scheme.
> 
> I manage my home directory by making it a git repo, and using
> ~/.gitignore to
> selectively permit certain files or subdirectories to be seen by git.
> The recent
> change in behavior has resulted in sensitive directories like ~/.gpg
> being
> un-ignored. For reference, I've appended my .gitignore to the end of
> this email.
> 
> So, is this behavior intended, or is this a bug? If the former, is there
> an
> announcement explaining this change?
> 
> -Charles
> 
> [snip]
> --
> 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

Works as intended for me:

├── baz
│   ├── quux
│   │   ├── corge
│   │   │   └── wibble.txt
│   │   └── grault.txt
│   └── waldo.txt
└── foo
    ├── bar.txt
    └── garply.txt

$ git status -s -uall
?? baz/quux/corge/wibble.txt
?? baz/quux/grault.txt
?? foo/bar.txt

garply.txt and waldo.txt are ignore, but the rest is still tracked.

I'm on 2.7.2.
--
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]