Re: git log --quiet bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 08, 2011 at 06:36:18AM -0800, Prasad Deshpande wrote:

>   I am seeing a bug with git log --quiet. It doesn't seem to be quiet
> :-). Also I have seen cases where the exit status returned is not
> correct i.e. its 0 even if there is some output (although I cant seem
> to reproduce that problem at present).

I think the description of "--quiet" in the git-log manpage is
accidentally inherited by including the diff options. In "git diff", it
stops output and makes the exit code useful for determining whether
there were changes. But what does the exit code even mean in the context
of "git log"?

It does look like there is code in "git log" to handle --quiet, and
convert it to "no diff output" (i.e., like "-s"). But it doesn't seem to
do anything. If I manually specify a format like "git log -p --quiet", I
still get output. And if I don't say "-p", then I wouldn't get diff
output anyway. It does seem to have an impact on other log variants that
have output by default (e.g., "git whatchanged --quiet" won't show the
usual raw diffs).

I think we should probably just excise it from the git-log manpage, like
this:

-- >8 --
Subject: [PATCH] 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 of log.

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
 Documentation/diff-options.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 08b581f..9f7cba2 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -412,15 +412,17 @@ endif::git-format-patch[]
 --function-context::
 	Show whole surrounding functions of changes.
 
 ifndef::git-format-patch[]
+ifndef::git-log[]
 --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.
 
 --quiet::
 	Disable all output of the program. Implies `--exit-code`.
+endif::git-log[]
 endif::git-format-patch[]
 
 --ext-diff::
 	Allow an external diff helper to be executed. If you set an
-- 
1.7.7.2.7.g9f96f

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]