git-log
man page将 --check
选项描述为与 --exit-code
选项不兼容。我想知道这个 --exit-code
是什么意思,但我无法在任何地方找到它。我试过 man git log
、man git
、Google 和直接搜索 SO... 无济于事!
--exit-code
对 git log
意味着什么?
最佳答案
TL;博士
I'd like to know what this
--exit-code
means [...]
--exit-code
是一个 diff-*
1 选项,它使 Git 命令以 1
退出> 如果有变化,则 0
否则。
[...] but I can't find it anywhere.
您可以在 git-diff
手册页中阅读它(它只在 git-log
手册页中提到)。
更多详情
--check
和 --exit-code
都在 git-diff
手册页中描述(更具体地说,在 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
选项不是,正如 commit message 中的以下 Git-project repository 所暗示的:
docs: don't mention
--quiet
or--exit-code
in git-log(1)These are
diff
-options, but they don't actually make sense in the context oflog
.
(1) diff-*
代表 porcelain git-diff
所基于的管道命令。
关于git - git log --exit-code 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32853972/