Re: [PATCH v3 0/3] interpret-trailers: add --where, --if-exists, --if-missing

2017-07-25 Thread Junio C Hamano
Paolo Bonzini  writes:

> From: Paolo Bonzini 
>
> These options are useful to experiment with "git interpret-trailers"
> without having to tinker with .gitconfig (Junio said git should ahve
> done this first and only added configuration afterwards).  It can
> be useful in the case where you want a different placement for the trailer,
> or for scripts/aliases that don't want to rely on specific .gitconfig
> settings.
>
> Compared to v2, the main change is that option order on the command-line
> is respected.  That is,
>
>   --trailer 'acked-by: foo' --where end --trailer 'signed-off-by: me'
>
> will only apply where=end to the second trailer.  Likewise,
>
>   --where end --trailer 'signed-off-by: me' --no-where \
>   --trailer 'acked-by: foo'
>
> will only apply it to the first, reverting to trailer.*.where for the
> "acked-by" trailer.

I am getting the following in my build after merging these to 'pu'.

trailer.c: In function 'apply_arg_if_exists':
trailer.c:270:2: error: enumeration value 'EXISTS_DEFAULT' not handled in 
switch [-Werror=switch]
  switch (arg_tok->conf.if_exists) {
  ^
trailer.c: In function 'apply_arg_if_missing':
trailer.c:307:2: error: enumeration value 'MISSING_DEFAULT' not handled in 
switch [-Werror=switch]
  switch (arg_tok->conf.if_missing) {
  ^
trailer.c: In function 'process_command_line_args':
trailer.c:717:3: error: ISO C90 forbids mixed declarations and code 
[-Werror=declaration-after-statement]
   int separator_pos = find_separator(string, cl_separators);
   ^
cc1: all warnings being treated as errors
m


[PATCH v3 0/3] interpret-trailers: add --where, --if-exists, --if-missing

2017-07-24 Thread Paolo Bonzini
From: Paolo Bonzini 

These options are useful to experiment with "git interpret-trailers"
without having to tinker with .gitconfig (Junio said git should ahve
done this first and only added configuration afterwards).  It can
be useful in the case where you want a different placement for the trailer,
or for scripts/aliases that don't want to rely on specific .gitconfig
settings.

Compared to v2, the main change is that option order on the command-line
is respected.  That is,

--trailer 'acked-by: foo' --where end --trailer 'signed-off-by: me'

will only apply where=end to the second trailer.  Likewise,

--where end --trailer 'signed-off-by: me' --no-where \
--trailer 'acked-by: foo'

will only apply it to the first, reverting to trailer.*.where for the
"acked-by" trailer.

Paolo

v1->v2: support --no-* options, minor code fixes

v2->v3: largely rewritten to respect option order on the command-line;
keep trailer.h namespace clean (Christian)

Paolo Bonzini (3):
  trailers: export action enums and corresponding lookup functions
  trailers: introduce struct new_trailer_item
  interpret-trailers: add options for actions

 Documentation/git-interpret-trailers.txt |  24 +++
 builtin/interpret-trailers.c |  73 ++--
 t/t7513-interpret-trailers.sh|  66 ++
 trailer.c| 113 ++-
 trailer.h|  43 +++-
 5 files changed, 267 insertions(+), 52 deletions(-)

-- 
2.13.3