diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-12-09 02:11:17 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-09 02:11:17 +0300 |
commit | 2aeafbc8967078b5b3804e03d48cc4d22fa045ca (patch) | |
tree | 4f7960f93be5ba54f0f6fb868afb850510748724 | |
parent | 3a0b884caba2752da0af626fb2de7d597c844e8b (diff) | |
parent | 0ee10fd12968b78dbd1ccbba108599a24f31f70b (diff) |
Merge branch 'jt/trace-error-on-warning'
Like die() and error(), a call to warning() will also trigger a
trace2 event.
* jt/trace-error-on-warning:
usage: add trace2 entry upon warning()
-rw-r--r-- | Documentation/technical/api-trace2.txt | 2 | ||||
-rw-r--r-- | usage.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/Documentation/technical/api-trace2.txt b/Documentation/technical/api-trace2.txt index 6b6085585d..c65ffafc48 100644 --- a/Documentation/technical/api-trace2.txt +++ b/Documentation/technical/api-trace2.txt @@ -466,7 +466,7 @@ completed.) `"error"`:: This event is emitted when one of the `error()`, `die()`, - or `usage()` functions are called. + `warning()`, or `usage()` functions are called. + ------------ { @@ -81,6 +81,12 @@ static void error_builtin(const char *err, va_list params) static void warn_builtin(const char *warn, va_list params) { + /* + * We call this trace2 function first and expect it to va_copy 'params' + * before using it (because an 'ap' can only be walked once). + */ + trace2_cmd_error_va(warn, params); + vreportf("warning: ", warn, params); } |