diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-08-01 11:03:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-14 12:23:28 -0700 |
commit | 0ea5292e6be2f37b647b744177cfe6cc5e6f605d (patch) | |
tree | 6b2c409d6404c15ac21bf66db760291cd5210890 /trailer.h | |
parent | 51166b8754e0df4ed3ee559ddcc4641035ec98ec (diff) | |
download | git-0ea5292e6be2f37b647b744177cfe6cc5e6f605d.tar.gz |
interpret-trailers: add options for actions
Allow using non-default values for trailers without having to set
them up in .gitconfig first. For example, if you have the following
configuration
trailer.signed-off-by.where = end
you may use "--where before" when a patch author forgets his
Signed-off-by and provides it in a separate email. Likewise for
--if-exists and --if-missing
Reverting to the behavior specified by .gitconfig is done with
--no-where, --no-if-exists and --no-if-missing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trailer.h')
-rw-r--r-- | trailer.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -4,12 +4,14 @@ #include "list.h" enum trailer_where { + WHERE_DEFAULT, WHERE_END, WHERE_AFTER, WHERE_BEFORE, WHERE_START }; enum trailer_if_exists { + EXISTS_DEFAULT, EXISTS_ADD_IF_DIFFERENT_NEIGHBOR, EXISTS_ADD_IF_DIFFERENT, EXISTS_ADD, @@ -17,6 +19,7 @@ enum trailer_if_exists { EXISTS_DO_NOTHING }; enum trailer_if_missing { + MISSING_DEFAULT, MISSING_ADD, MISSING_DO_NOTHING }; @@ -54,6 +57,10 @@ struct new_trailer_item { struct list_head list; const char *text; + + enum trailer_where where; + enum trailer_if_exists if_exists; + enum trailer_if_missing if_missing; }; void process_trailers(const char *file, int in_place, int trim_empty, |