git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git ignore help

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 24, 2015, 01:55 UTC
Message-ID
<CAPig+cT5=3kzEu4CzfYW3QtKqDDHn5uSwocoscFLU-T9M-+wiw@mail.gmail.com>
In-Reply-To
<CACsJy8CGuuRTGycj13cT9d-n=HavzL4LVWC7xjD4Ac=KQGEhBg@mail.gmail.com>
On Mon, Mar 23, 2015 at 9:00 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 23 quoted lines
> On Sun, Mar 22, 2015 at 10:33 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> On Fri, Mar 20, 2015 at 6:36 AM,  <mdconf@seznam.cz> wrote:
>>> Any idea what I am doing wrong?
>>
>> The fourth bullet point of the "Pattern Format" section of the
>> gitignore man page has this to say, which explains the behavior you're
>> seeing:
>>
>>     An optional prefix "!" which negates the pattern; any matching
>>     file excluded by a previous pattern will become included again.
>>     It is not possible to re-include a file if a parent directory of
>>     that file is excluded. Git doesn’t list excluded directories for
>>     performance reasons, so any patterns on contained files have no
>>     effect, no matter where they are defined.
>
> This is true. To elaborate, if we have to recurse in excluded
> directories so that we can include some back, then the reason for
> excluding is already defeated as we may need to traverse the entire
> directory structure. However in this particular case where we do know
> in advance that only certain directories may have "re-include" rules,
> e.g. "db", "reports" or "scripts", we could keep going for a while. I
> think I attempted to do this in the past and failed (don't remember
> exactly why). Maybe I'll try again some time in future.

I also was pretty sure that you had attempted this, but couldn't find a reference to it, so I didn't mention it in my response. However, with some more digging, I finally located it[1].

[1]: http://article.gmane.org/gmane.comp.version-control.git/259870
Show 5 quoted lines
> Another option is, if the user is willing to accept performance
> degradation (in many small repos, it does not matter anyway), then we
> could keep digging in.
> --
> Duy
Previous: Duy NguyenNext: Duy Nguyen
Message 4 of 9 in “Git ignore help”
  1. mdconf@seznam.czMar 20, 2015
  2. Eric SunshineMar 22, 2015
  3. Duy NguyenMar 24, 2015
  4. Eric SunshineMar 24, 2015
  5. Duy NguyenMar 24, 2015
  6. mdconf@seznam.czMar 24, 2015
  7. Duy NguyenMar 24, 2015
  8. Eric SunshineMar 24, 2015
  9. Junio C HamanoMar 24, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.