From: Junio C Hamano Date: Tue, 20 Jul 2010 20:27:07 GMT Subject: Re: [PATCH 1/2] Add -e/--exclude to git-clean. Message-ID: <7vr5ixlx0k.fsf@alter.siamese.dyndns.org> In-Reply-To: <8f454efeb3aa4acd0e0c420b197d0269dc53db34.1279654370.git.jaredhance@gmail.com> Jared Hance writes: > With the -e/--exclude option for git-clean, a user can specify files > that they haven't yet told git about, but either need for a short amount > of time or plan to tell git about them later. This allows one to still > use git-clean while these files are around without losing data. > > Signed-off-by: Jared Hance Thanks. > +static int exclude_cb(const struct option *opt, const char *arg, int unset) > +{ > + struct string_list *exclude_list = (struct string_list *)opt->value; Unnecessary cast, as opt->value is of type (void *). > @@ -36,6 +44,7 @@ int cmd_clean(int argc, const char **argv, const char *prefix) > struct dir_struct dir; > static const char **pathspec; > struct strbuf buf = STRBUF_INIT; > + struct string_list exclude_list = { NULL, 0, 0, 0 }; Mental note to myself. We should convert this to use STRING_LIST_INIT after the next release when Thiago's patch graduates to 'master'.