summaryrefslogtreecommitdiff
path: root/apply.h
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2016-09-04 20:18:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-07 19:29:53 (GMT)
commita46160d27ebdcd609aeae60b6163548af337d280 (patch)
treeb0a16824d7049e0298993212dccab0791cf13dc3 /apply.h
parent90875eca5a0b227e6a1be3ccece0a3da5e72017f (diff)
downloadgit-a46160d27ebdcd609aeae60b6163548af337d280.zip
git-a46160d27ebdcd609aeae60b6163548af337d280.tar.gz
git-a46160d27ebdcd609aeae60b6163548af337d280.tar.bz2
apply: make it possible to silently apply
This changes 'int apply_verbosely' into 'enum apply_verbosity', and changes the possible values of the variable from a bool to a tristate. The previous 'false' state is changed into 'verbosity_normal'. The previous 'true' state is changed into 'verbosity_verbose'. The new added state is 'verbosity_silent'. It should prevent anything to be printed on both stderr and stdout. This is needed because `git am` wants to first call apply functionality silently, if it can then fall back on 3-way merge in case of error. Printing on stdout, and calls to warning() or error() are not taken care of in this patch, as that will be done in following patches. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'apply.h')
-rw-r--r--apply.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/apply.h b/apply.h
index 51b983b..f015403 100644
--- a/apply.h
+++ b/apply.h
@@ -13,6 +13,12 @@ enum apply_ws_ignore {
ignore_ws_change
};
+enum apply_verbosity {
+ verbosity_silent = -1,
+ verbosity_normal = 0,
+ verbosity_verbose = 1
+};
+
/*
* We need to keep track of how symlinks in the preimage are
* manipulated by the patches. A patch to add a/b/c where a/b
@@ -51,13 +57,13 @@ struct apply_state {
int allow_overlap;
int apply_in_reverse;
int apply_with_reject;
- int apply_verbosely;
int no_add;
int threeway;
int unidiff_zero;
int unsafe_paths;
/* Other non boolean parameters */
+ enum apply_verbosity apply_verbosity;
const char *fake_ancestor;
const char *patch_input_file;
int line_termination;