# Is there an API to the .gitignore capability?

2 messages from 2013-06-02 to 2013-06-03. Participants: Peng Yu, Duy Nguyen.
Thread: https://gitlist.dev/t/34011

## Peng Yu, 2013-06-02 14:40

Subject: Is there an API to the .gitignore capability?
Message-ID: <CABrM6wnJYSGGsj=ZxHOFRMmDCSgsU0dFwxus=h1PtVazgpg3ug@mail.gmail.com>
URL: https://gitlist.dev/e/CABrM6wnJYSGGsj%3DZxHOFRMmDCSgsU0dFwxus%3Dh1PtVazgpg3ug%40mail.gmail.com

```
Hi,

.gitignore is a flexible way to customize what dir/file to search or
not to search. So it is of general use and is more flexible than what
is offered by "find". I'm wondering if there is an API than I can use
besides using it within git. Thanks.

-- 
Regards,
Peng

```

## Duy Nguyen, 2013-06-03 23:04

Subject: Re: Is there an API to the .gitignore capability?
Message-ID: <CACsJy8DzcZ6PxBkGyYDobTZmY6sKF0ANhXnkz9xnULPG5USiNg@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DzcZ6PxBkGyYDobTZmY6sKF0ANhXnkz9xnULPG5USiNg%40mail.gmail.com
In-Reply-To: <CABrM6wnJYSGGsj=ZxHOFRMmDCSgsU0dFwxus=h1PtVazgpg3ug@mail.gmail.com>

```
On Sun, Jun 2, 2013 at 9:40 PM, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> .gitignore is a flexible way to customize what dir/file to search or
> not to search. So it is of general use and is more flexible than what
> is offered by "find". I'm wondering if there is an API than I can use
> besides using it within git. Thanks.

Git provides no C API, if that's what you mean. You can link with
libgit.a, but there's no guarantee it won't break someday. At a higher
"API" level such as shell scripting, still "no", but I think you could
modify "git ls-files" to support running 'ls-files -i' without a git
repository (like git-grep --no-index). I think it'll work, mostly, but
not entirely sure.
--
Duy

```
