Re: [PATCH v4 08/17] trailer: add interpret-trailers command

2014-02-06 Thread Christian Couder
From: Eric Sunshine 
>
> On Thu, Jan 30, 2014 at 1:49 AM, Christian Couder
>  wrote:
>> diff --git a/trailer.h b/trailer.h
>> new file mode 100644
>> index 000..9db4459
>> --- /dev/null
>> +++ b/trailer.h
>> @@ -0,0 +1,6 @@
>> +#ifndef TRAILER_H
>> +#define TRAILER_H
>> +
>> +void process_trailers(const char *infile, int trim_empty, int argc, const 
>> char **argv);
>> +
>> +#endif /* TRAILER_H */
> 
> One might reasonably expect trailer.h and the process_trailers()
> declaration to be introduced by patch 7/17 ("trailer: put all the
> processing together and print") in which process_trailers() is defined
> in trailer.c.

On the other hand, I think that it is not so nice to add a header file
like trailer.h unless it is included at least once.

Maybe I can squash this patch with the previous one, but then the
series might be a little bit more difficult to understand.

Thanks,
Christian.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v4 08/17] trailer: add interpret-trailers command

2014-01-31 Thread Eric Sunshine
On Thu, Jan 30, 2014 at 1:49 AM, Christian Couder
 wrote:
> This patch adds the "git interpret-trailers" command.
> This command uses the previously added process_trailers()
> function in trailer.c.
>
> Signed-off-by: Christian Couder 
> ---
> diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
> new file mode 100644
> index 000..04b0ae2
> --- /dev/null
> +++ b/builtin/interpret-trailers.c
> @@ -0,0 +1,36 @@
> +int cmd_interpret_trailers(int argc, const char **argv, const char *prefix)
> +{
> +   const char *infile = NULL;
> +   int trim_empty = 0;
> +
> +   struct option options[] = {
> +   OPT_BOOL(0, "trim-empty", &trim_empty, N_("trim empty 
> trailers")),
> +   OPT_FILENAME(0, "infile", &infile, N_("use message from 
> file")),
> +   OPT_END()
> +   };
> +
> +   argc = parse_options(argc, argv, prefix, options,
> +git_interpret_trailers_usage, 0);
> +
> +   process_trailers(infile, trim_empty, argc, argv);
> +
> +   return 0;
> +}
> diff --git a/trailer.h b/trailer.h
> new file mode 100644
> index 000..9db4459
> --- /dev/null
> +++ b/trailer.h
> @@ -0,0 +1,6 @@
> +#ifndef TRAILER_H
> +#define TRAILER_H
> +
> +void process_trailers(const char *infile, int trim_empty, int argc, const 
> char **argv);
> +
> +#endif /* TRAILER_H */

One might reasonably expect trailer.h and the process_trailers()
declaration to be introduced by patch 7/17 ("trailer: put all the
processing together and print") in which process_trailers() is defined
in trailer.c.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html