From: Eric Sunshine Date: Thu, 28 May 2015 23:05:43 GMT Subject: Re: [PATCH/WIP 4/8] am: split out mbox/maildir patches with git-mailsplit Message-ID: In-Reply-To: <1432733618-25629-5-git-send-email-pyokagan@gmail.com> On Wed, May 27, 2015 at 9:33 AM, Paul Tan wrote: > git-am.sh supports mbox, stgit and mercurial patches. Re-implement > support for splitting out mbox/maildirs using git-mailsplit, while also > implementing the framework required to support other patch formats in > the future. > > Re-implement support for the --patch-format option (since a5a6755 > (git-am foreign patch support: introduce patch_format, 2009-05-27)) to > allow the user to choose between the different patch formats. > > Signed-off-by: Paul Tan > --- > @@ -128,13 +190,32 @@ static void am_next(struct am_state *state) > */ > +/** > + * parse_options() callback that validates and sets opt->value to the > + * PATCH_FORMAT_* enum value corresponding to `arg`. > + */ > +static int parse_opt_patchformat(const struct option *opt, const char *arg, int unset) > +{ > + int *opt_value = opt->value; > + > + if (!strcmp(arg, "mbox")) > + *opt_value = PATCH_FORMAT_MBOX; > + else > + return -1; > + return 0; > +} > + > struct am_state state; > +int opt_patch_format; Should these two variables be static? > static const char * const am_usage[] = { > N_("git am [options] [(|)...]"),