����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
Error reporting in git
======================
`BUG`, `bug`, `die`, `usage`, `error`, and `warning` report errors of
various kinds.
- `BUG` is for failed internal assertions that should never happen,
i.e. a bug in git itself.
- `bug` (lower-case, not `BUG`) is supposed to be used like `BUG` but
prints a "BUG" message instead of calling `abort()`.
+
A call to `bug()` will then result in a "real" call to the `BUG()`
function, either explicitly by invoking `BUG_if_bug()` after call(s)
to `bug()`, or implicitly at `exit()` time where we'll check if we
encountered any outstanding `bug()` invocations.
+
If there were no prior calls to `bug()` before invoking `BUG_if_bug()`
the latter is a NOOP. The `BUG_if_bug()` function takes the same
arguments as `BUG()` itself. Calling `BUG_if_bug()` explicitly isn't
necessary, but ensures that we die as soon as possible.
+
If you know you had prior calls to `bug()` then calling `BUG()` itself
is equivalent to calling `BUG_if_bug()`, the latter being a wrapper
calling `BUG()` if we've set a flag indicating that we've called
`bug()`.
+
This is for the convenience of APIs who'd like to potentially report
more than one "bug", such as the optbug() validation in
parse-options.c.
- `die` is for fatal application errors. It prints a message to
the user and exits with status 128.
- `usage` is for errors in command line usage. After printing its
message, it exits with status 129. (See also `usage_with_options`
in the link:api-parse-options.html[parse-options API].)
- `error` is for non-fatal library errors. It prints a message
to the user and returns -1 for convenience in signaling the error
to the caller.
- `warning` is for reporting situations that probably should not
occur but which the user (and Git) can continue to work around
without running into too many problems. Like `error`, it
returns -1 after reporting the situation to the caller.
These reports will be logged via the trace2 facility. See the "error"
event in link:api-trace2.html[trace2 API].
Customizable error handlers
---------------------------
The default behavior of `die` and `error` is to write a message to
stderr and then exit or return as appropriate. This behavior can be
overridden using `set_die_routine` and `set_error_routine`. For
example, "git daemon" uses set_die_routine to write the reason `die`
was called to syslog before exiting.
Library errors
--------------
Functions return a negative integer on error. Details beyond that
vary from function to function:
- Some functions return -1 for all errors. Others return a more
specific value depending on how the caller might want to react
to the error.
- Some functions report the error to stderr with `error`,
while others leave that for the caller to do.
- errno is not meaningful on return from most functions (except
for thin wrappers for system calls).
Check the function's API documentation to be sure.
Caller-handled errors
---------------------
An increasing number of functions take a parameter 'struct strbuf *err'.
On error, such functions append a message about what went wrong to the
'err' strbuf. The message is meant to be complete enough to be passed
to `die` or `error` as-is. For example:
if (ref_transaction_commit(transaction, &err))
die("%s", err.buf);
The 'err' parameter will be untouched if no error occurred, so multiple
function calls can be chained:
t = ref_transaction_begin(&err);
if (!t ||
ref_transaction_update(t, "HEAD", ..., &err) ||
ret_transaction_commit(t, &err))
die("%s", err.buf);
The 'err' parameter must be a pointer to a valid strbuf. To silence
a message, pass a strbuf that is explicitly ignored:
if (thing_that_can_fail_in_an_ignorable_way(..., &err))
/* This failure is okay. */
strbuf_reset(&err);
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| api-error-handling.adoc | File | 3.73 KB | 0644 |
|
| api-error-handling.html | File | 35.21 KB | 0644 |
|
| api-index-skel.adoc | File | 432 B | 0644 |
|
| api-index.adoc | File | 689 B | 0644 |
|
| api-index.html | File | 30.43 KB | 0644 |
|
| api-index.sh | File | 714 B | 0644 |
|
| api-merge.adoc | File | 1.06 KB | 0644 |
|
| api-merge.html | File | 31.51 KB | 0644 |
|
| api-parse-options.adoc | File | 13.01 KB | 0644 |
|
| api-parse-options.html | File | 49.44 KB | 0644 |
|
| api-path-walk.adoc | File | 3.27 KB | 0644 |
|
| api-path-walk.html | File | 34.28 KB | 0644 |
|
| api-simple-ipc.adoc | File | 4.74 KB | 0644 |
|
| api-simple-ipc.html | File | 35.49 KB | 0644 |
|
| api-trace2.adoc | File | 43.45 KB | 0644 |
|
| api-trace2.html | File | 86.12 KB | 0644 |
|
| bitmap-format.adoc | File | 14.66 KB | 0644 |
|
| bitmap-format.html | File | 49.31 KB | 0644 |
|
| build-systems.adoc | File | 7.96 KB | 0644 |
|
| build-systems.html | File | 41.02 KB | 0644 |
|
| bundle-uri.adoc | File | 26.12 KB | 0644 |
|
| bundle-uri.html | File | 63.08 KB | 0644 |
|
| commit-graph.adoc | File | 17.7 KB | 0644 |
|
| commit-graph.html | File | 52.61 KB | 0644 |
|
| directory-rename-detection.adoc | File | 5.08 KB | 0644 |
|
| directory-rename-detection.html | File | 36.33 KB | 0644 |
|
| hash-function-transition.adoc | File | 35.45 KB | 0644 |
|
| hash-function-transition.html | File | 75.42 KB | 0644 |
|
| large-object-promisors.adoc | File | 26.59 KB | 0644 |
|
| large-object-promisors.html | File | 62.72 KB | 0644 |
|
| long-running-process-protocol.adoc | File | 1.88 KB | 0644 |
|
| long-running-process-protocol.html | File | 32.18 KB | 0644 |
|
| meson.build | File | 1.49 KB | 0644 |
|
| multi-pack-index.adoc | File | 11.31 KB | 0644 |
|
| multi-pack-index.html | File | 44.62 KB | 0644 |
|
| pack-heuristics.adoc | File | 17.62 KB | 0644 |
|
| pack-heuristics.html | File | 54.83 KB | 0644 |
|
| packfile-uri.adoc | File | 3.66 KB | 0644 |
|
| packfile-uri.html | File | 34.64 KB | 0644 |
|
| parallel-checkout.adoc | File | 12.01 KB | 0644 |
|
| parallel-checkout.html | File | 44.27 KB | 0644 |
|
| partial-clone.adoc | File | 14.59 KB | 0644 |
|
| partial-clone.html | File | 48.96 KB | 0644 |
|
| platform-support.adoc | File | 8.95 KB | 0644 |
|
| platform-support.html | File | 40.71 KB | 0644 |
|
| racy-git.adoc | File | 8.91 KB | 0644 |
|
| racy-git.html | File | 41.04 KB | 0644 |
|
| reftable.adoc | File | 36.65 KB | 0644 |
|
| reftable.html | File | 86.46 KB | 0644 |
|
| remembering-renames.adoc | File | 29.71 KB | 0644 |
|
| remembering-renames.html | File | 65.78 KB | 0644 |
|
| repository-version.adoc | File | 3.19 KB | 0644 |
|
| repository-version.html | File | 33.92 KB | 0644 |
|
| rerere.adoc | File | 6.36 KB | 0644 |
|
| rerere.html | File | 38.33 KB | 0644 |
|
| scalar.adoc | File | 2.87 KB | 0644 |
|
| scalar.html | File | 33.61 KB | 0644 |
|
| send-pack-pipeline.adoc | File | 1.92 KB | 0644 |
|
| send-pack-pipeline.html | File | 32.41 KB | 0644 |
|
| shallow.adoc | File | 2.49 KB | 0644 |
|
| shallow.html | File | 32.77 KB | 0644 |
|
| sparse-checkout.adoc | File | 46.68 KB | 0644 |
|
| sparse-checkout.html | File | 92.36 KB | 0644 |
|
| sparse-index.adoc | File | 9.28 KB | 0644 |
|
| sparse-index.html | File | 41.79 KB | 0644 |
|
| trivial-merge.adoc | File | 4.16 KB | 0644 |
|
| trivial-merge.html | File | 35.33 KB | 0644 |
|
| unit-tests.adoc | File | 9.8 KB | 0644 |
|
| unit-tests.html | File | 50.73 KB | 0644 |
|