Subject: Re: [PATCH] git-apply - Add --include=PATH

From: Joe Perches <[email-masked]>
Date: Sun, 24 Aug 2008 14:57:43 -0700

On Sat, 2008-08-23 at 17:54 -0700, Junio C Hamano wrote:
> Joe Perches <[email-masked]> 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