git-log
手册描述--check
选项与--exit-code
选项不兼容。我想知道这个--exit-code
是什么意思,但是我到处都找不到。我已经尝试了man git log
, man git
,谷歌和直接搜索在这里SO…没有用!
--exit-code
对git log
意味着什么?
;我想知道这个--exit-code
是什么意思[…]
我想知道这个--exit-code
是什么意思[…]
--exit-code
是diff-*
1选项,如果有更改,则使Git命令退出1
,否则退出0
。
[…但是我到处都找不到。
你可以在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
选项不是,正如git项目存储库中的以下提交消息所暗示的那样:
docs:不要在git-log(1)中提及
--quiet
或--exit-code
这些是
diff
选项,但它们实际上没有意义在log
.
(1) diff-*
表示瓷器git-diff
所基于的管道命令
在git-diff文档中提到过(显然不打算与git-log
一起使用):
"使用类似于diff(1)的代码退出程序。也就是说,如果存在差异,它以1退出,0表示没有差异。"