Re: something like git-check-ignore but considering only patterns?

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

 



On Wed, Dec 29, 2021 at 12:54 PM Britton Kerin <britton.kerin@xxxxxxxxx> wrote:
>
> I'd like to query if a file e.g. symLinkToDir/foo.o would be ignored
> if it were in a real dir instead (don't ask) but in a general way and
> hopefully without parsing and matching all the .gitignore entries
> myself.  Is it possible?

How would that even work?  If there is just one gitignore pattern and it was:

    build/*

And you tried to ask (making up a new `--patterns` flag):

    git check-ignore --patterns '*/foo.o'

What should the command return?  True?  False?  It kinda depends on
what that '*' actually is.  If it's "build" then it's ignored.  If
it's not, then for this example it wouldn't be ignored.  So the best
answer we would be able to give is "maybe", which isn't particularly
useful.  Also, typical cases will be much more complex than that.  So
we can only answer whether specific paths are ignored, not whether
various globs would be.



[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