Subject: Re: Query about gitignore

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 7 Feb 2024 06:43:36 +0100

Hi Divyaditya,

On Wed, Feb 07, 2024 at 01:56:34AM +0530, Divyaditya Singh wrote:
> Hello there,
> 
> I hope you are having a wonderful day.
> 
> I apologize if this is inappropriate but I wanted to ask is there a
> way that I can make my .gitignore such that it ignores the entire
> parent directory of a matching file.

Not inappropriate at all!

Rephrasing what you say, you basically want to ignore "dir/" if and only
if "dir/a" exists and matches a specific pattern in your gitignore,
right? If so, this is not something that you can currently achieve with
gitignores.

Would you mind maybe explaining your particular usecase a bit more? This
_could_ help to find a different solution for you. But even if there is
none it might motivate others to think about possible ways to implement
this in Git if there is interest.

Patrick