Re: [PATCH 1/2] Add -e/--exclude to git-clean.
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:09
Jared Hance [off-list ref] 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 <redacted>
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 *).
quoted hunk
@@ -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'.