public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Pushkar Singh <pushkarkumarsingh1970@gmail.com>,
	"alf.clement@gmail.com" <alf.clement@gmail.com>,
	 "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: .gitignore issue
Date: Wed, 21 Jan 2026 13:09:37 -0800	[thread overview]
Message-ID: <xmqq343ysmem.fsf@gitster.g> (raw)
In-Reply-To: <20260121210312.GA723458@coredump.intra.peff.net> (Jeff King's message of "Wed, 21 Jan 2026 16:03:12 -0500")

Jeff King <peff@peff.net> writes:

> On Wed, Jan 21, 2026 at 06:51:02PM +0000, Pushkar Singh wrote:
>
>> This is expected behavior.
>> When a directory matches an ignore rule, Git stops descending into it entirely. The pattern
>> 
>>         backup_STOCKS*/
>> 
>> matches directories starting with backup_STOCKS, and once Git prunes traversal at that level, similarly prefixed paths can disappear from git status, which is why backups/ no longer shows up.
>> 
>> This isn’t a bug, but a result of how ignore patterns and directory pruning work.
>
> I found this explanation confusing: surely we would never match
> "backups/" itself via a pattern like "backup_STOCKS*". And I'm not sure
> what you mean by "similarly prefixed paths".

Great minds think alike.  I was writing almost identical response
about backups/ being full of backups/backup_STOCKS_{1,2,3,4} and
nothing unignored in there.

> We can't know for certain this is what's going on because Alf didn't
> show us what's in the backups/ directory, but one imagines it is also
> full of backup_STOCKS_* directories.

Thanks.

  reply	other threads:[~2026-01-21 21:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 18:51 .gitignore issue Pushkar Singh
2026-01-21 21:03 ` Jeff King
2026-01-21 21:09   ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-21 18:32 Alf Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq343ysmem.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=alf.clement@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=pushkarkumarsingh1970@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox