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

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

From
Joe Perches <joe@perches.com>
Date
Aug 24, 2008, 21:57 UTC
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:
Show 19 quoted lines
> Joe Perches <joe@perches.com> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “git-apply - Add --include=PATH”
  1. git-apply - Add --include=PATHJoe Perches, Aug 23, 2008
  2. Junio C HamanoAug 24, 2008
  3. Joe PerchesAug 24, 2008
  4. Junio C HamanoAug 25, 2008

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.