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!
What does --exit-code mean for git log?
You can press q to exit. git hist is using a pager tool so you can scroll up and down the results before returning to the console.
By default, git log includes merge commits in its output. But, if your team has an always-merge policy (that is, you merge upstream changes into topic branches instead of rebasing the topic branch onto the upstream branch), you'll have a lot of extraneous merge commits in your project history.
What does git log do? The git log command displays all of the commits in a repository's history. By default, the command displays each commit's: Secure Hash Algorithm (SHA) author.
The command for that would be git log –oneline -n where n represents the number up to which commit you to want to see the logs.
I'd like to know what this
--exit-codemeans [...]
--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.
You can read about it in the git-diff man page (it's only mentioned in passing in the git-log man page).
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.
and
--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.
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: don't mention
--quietor--exit-codein git-log(1)These are
diff-options, but they don't actually make sense in the context oflog.
(1) diff-* stands for the plumbing commands that porcelain git-diff is based on.
It's mentioned in the git-diff docs (and is apparently not intended to be used with git-log):
"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."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With