summaryrefslogtreecommitdiff
path: root/Documentation/git-cat-file.txt
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-06-22 06:45:17 -0400
committerJunio C Hamano <gitster@pobox.com>2015-06-22 14:55:52 -0700
commitfc4937c37219347f4e2c25a271577b333942453f (patch)
treec62993cbd67f3ec4e766e7cd470e9cfb28d436dc /Documentation/git-cat-file.txt
parentbfd155943eecedb7b7e759ff022ca09e68f941b0 (diff)
downloadgit-fc4937c37219347f4e2c25a271577b333942453f.tar.gz
cat-file: add --buffer option
We use a direct write() to output the results of --batch and --batch-check. This is good for processes feeding the input and reading the output interactively, but it introduces measurable overhead if you do not want this feature. For example, on linux.git: $ git rev-list --objects --all | cut -d' ' -f1 >objects $ time git cat-file --batch-check='%(objectsize)' \ <objects >/dev/null real 0m5.440s user 0m5.060s sys 0m0.384s This patch adds an option to use regular stdio buffering: $ time git cat-file --batch-check='%(objectsize)' \ --buffer <objects >/dev/null real 0m4.975s user 0m4.888s sys 0m0.092s Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-cat-file.txt')
-rw-r--r--Documentation/git-cat-file.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/git-cat-file.txt b/Documentation/git-cat-file.txt
index 319ab4cb08..0058bd42aa 100644
--- a/Documentation/git-cat-file.txt
+++ b/Documentation/git-cat-file.txt
@@ -69,6 +69,13 @@ OPTIONS
not be combined with any other options or arguments. See the
section `BATCH OUTPUT` below for details.
+--buffer::
+ Normally batch output is flushed after each object is output, so
+ that a process can interactively read and write from
+ `cat-file`. With this option, the output uses normal stdio
+ buffering; this is much more efficient when invoking
+ `--batch-check` on a large number of objects.
+
--allow-unknown-type::
Allow -s or -t to query broken/corrupt objects of unknown type.