git log --exit-code是什么意思? [英] What does git log --exit-code mean?
问题描述
git-log
手册页将-check
选项描述为与-exit-code
选项不兼容。我想知道-退出代码
的含义,但我在任何地方都找不到。我试过 man git log
, man git
,Google并在此处直接搜索...无济于事!
The git-log
man page describes the --check
option as incompatible with the --exit-code
option. I'd like to know what this --exit-code
means but I can't find it anywhere. I've tried man git log
, man git
, Google and direct search here on SO... to no avail!
-退出代码
对 git log $ c意味着什么? $ c>?
推荐答案
TL; DR
TL; DR
我想知道这
-退出代码
的含义[...]
-退出代码
是 diff-*
1 选项,如果有更改,该选项使Git命令以 1
退出,并且 0
否则。
--exit-code
is a diff-*
1 option that makes the Git command exit with 1
if there are changes, and 0
otherwise.
[...]但我找不到它
[...] but I can't find it anywhere.
您可以在 git-diff
手册页中了解它。 (仅在传递 git-log
手册页时提及)。
You can read about it in the git-diff
man page (it's only mentioned in passing in the git-log
man page).
-check
和-exit-code
git-diff
手册页(更具体地说,在 Documentation / diff-options.txt
):
Both --check
and --exit-code
are described in the git-diff
man page (more specifically, in Documentation/diff-options.txt
):
--check
Warn if changes introduce whitespace errors. What are considered
whitespace errors is controlled by core.whitespace configuration.
By default, trailing whitespaces (including lines that solely
consist of whitespaces) and a space character that is immediately
followed by a tab character inside the initial indent of the line
are considered whitespace errors. Exits with non-zero status if
problems are found. Not compatible with --exit-code.
和
--exit-code
Make the program exit with codes similar to diff(1). That is, it
exits with 1 if there were differences and 0 means no differences.
有些,尽管不是全部, diff -*
选项与 git-log
兼容。 -check
选项是,而-exit-code
选项不是,如下所示提交消息来自 Git项目存储库:
Some, though not all, diff-*
options are compatible with git-log
. The --check
option is, whereas the --exit-code
option is not, as hinted at by the following commit message from the Git-project repository:
docs:不要提及
-quiet
或-exit-code
在git-log(1)
docs: don't mention
--quiet
or--exit-code
in git-log(1)
这些是 diff
选项,但在 log $ c的情况下,它们实际上对
没有意义。 $ c>。
These are diff
-options, but they don't actually make sense
in the context of log
.
(1) diff-*
立场<瓷器 git-diff
所基于的管道命令。
(1) diff-*
stands for the plumbing commands that porcelain git-diff
is based on.
这篇关于git log --exit-code是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!