git log --exit-code是什么意思? [英] What does git log --exit-code mean?

查看:99
本文介绍了git log --exit-code是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

推荐答案

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>。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆