From: Joe Perches Date: Sun, 24 Aug 2008 21:57:43 GMT Subject: Re: [PATCH] git-apply - Add --include=PATH Message-ID: <1219615063.18365.141.camel@localhost> In-Reply-To: <7viqtrw7up.fsf@gitster.siamese.dyndns.org> On Sat, 2008-08-23 at 17:54 -0700, Junio C Hamano wrote: > Joe Perches writes: > > Add similar capability to --exclude= > > Allows selection of files to patch from a > > large patchset. > Thanks; I don't see anything fundamentally wrong with what this patch > tries to achieve. > > > @@ -2996,10 +2996,16 @@ static struct excludes { > > const char *path; > > } *excludes; > > > > +static struct includes { > > + struct includes *next; > > + const char *path; > > +} *includes; > > Now this is ugly. You can just add a new variable "*includes" that is of > exactly the same type as existing "*excludes" without introducing a new > type. Yes, it's slightly ugly, but it was less work and much easier for a human to parse. I also didn't want to use "struct excludes" for includes which I thought even uglier. > You should then find it disturbing that the shared type is still called > "struct excludes" even though it is now used for things you would want to > include. You are right. You can then either rename it to a more neutral > name, or (even better) use an existing type, such as "string_list". I'm on holiday for a few days, but I'll submit 2 patches later: 1. Rename struct excludes to struct path_list 2. Add --includes cheers, Joe