1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 14:57:52 +01:00
git/builtin
Jeff King 6a951937ae cat-file: add --batch-all-objects option
It can sometimes be useful to examine all objects in the
repository. Normally this is done with "git rev-list --all
--objects", but:

  1. That shows only reachable objects. You may want to look
     at all available objects.

  2. It's slow. We actually open each object to walk the
     graph. If your operation is OK with seeing unreachable
     objects, it's an order of magnitude faster to just
     enumerate the loose directories and pack indices.

You can do this yourself using "ls" and "git show-index",
but it's non-obvious.  This patch adds an option to
"cat-file --batch-check" to operate on all available
objects (rather than reading names from stdin).

This is based on a proposal by Charles Bailey to provide a
separate "git list-all-objects" command. That is more
orthogonal, as it splits enumerating the objects from
getting information about them. However, in practice you
will either:

  a. Feed the list of objects directly into cat-file anyway,
     so you can find out information about them. Keeping it
     in a single process is more efficient.

  b. Ask the listing process to start telling you more
     information about the objects, in which case you will
     reinvent cat-file's batch-check formatter.

Adding a cat-file option is simple and efficient. And if you
really do want just the object names, you can always do:

  git cat-file --batch-check='%(objectname)' --batch-all-objects

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-22 14:55:52 -07:00
..
add.c Merge branch 'jk/add-e-kill-editor' 2015-05-22 12:41:55 -07:00
annotate.c
apply.c Merge branch 'bc/object-id' 2015-05-05 21:00:23 -07:00
archive.c
bisect--helper.c
blame.c Merge branch 'rs/janitorial' 2015-06-01 12:45:15 -07:00
branch.c Merge branch 'dl/branch-error-message' 2015-05-22 12:41:41 -07:00
bundle.c bundle: verify arguments more strictly 2015-05-08 10:52:11 -07:00
cat-file.c cat-file: add --batch-all-objects option 2015-06-22 14:55:52 -07:00
check-attr.c standardize usage info string format 2015-01-14 09:32:04 -08:00
check-ignore.c standardize usage info string format 2015-01-14 09:32:04 -08:00
check-mailmap.c standardize usage info string format 2015-01-14 09:32:04 -08:00
check-ref-format.c standardize usage info string format 2015-01-14 09:32:04 -08:00
checkout-index.c prefix_path(): unconditionally free results in the callers 2015-05-05 10:31:51 -07:00
checkout.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
clean.c Merge branch 'rs/janitorial' 2015-06-01 12:45:15 -07:00
clone.c Merge branch 'mh/clone-verbosity-fix' 2015-05-22 12:41:56 -07:00
column.c standardize usage info string format 2015-01-14 09:32:04 -08:00
commit-tree.c commit-tree: simplify parsing of option -S using skip_prefix() 2014-12-29 09:32:45 -08:00
commit.c Merge branch 'nd/untracked-cache' 2015-05-26 13:24:46 -07:00
config.c Sync with 2.3.8 2015-05-11 14:39:28 -07:00
count-objects.c
credential.c
describe.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff-files.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff-index.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff-tree.c standardize usage info string format 2015-01-14 09:32:04 -08:00
diff.c
fast-export.c
fetch-pack.c standardize usage info string format 2015-01-14 09:32:04 -08:00
fetch.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
fmt-merge-msg.c Merge branch 'jc/plug-fmt-merge-msg-leak' 2015-05-11 14:23:46 -07:00
for-each-ref.c Merge branch 'rs/simple-cleanups' into maint 2015-03-06 14:57:57 -08:00
fsck.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
gc.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
get-tar-commit-id.c
grep.c Merge branch 'ps/grep-help-all-callback-arg' 2015-04-20 15:28:34 -07:00
hash-object.c Merge branch 'jc/hash-object' 2015-05-11 14:23:59 -07:00
help.c Merge branch 'sb/leaks' 2015-03-20 13:11:53 -07:00
index-pack.c Merge branch 'nd/slim-index-pack-memory-usage' 2015-05-11 14:23:44 -07:00
init-db.c Merge branch 'jk/init-core-worktree-at-root' into maint 2015-05-13 14:05:49 -07:00
interpret-trailers.c
log.c blame, log: format usage strings similarly to those in documentation 2015-05-03 16:55:26 -07:00
ls-files.c Merge branch 'jc/report-path-error-to-dir' into maint 2015-03-31 14:53:08 -07:00
ls-remote.c standardize usage info string format 2015-01-14 09:32:04 -08:00
ls-tree.c
mailinfo.c standardize usage info string format 2015-01-14 09:32:04 -08:00
mailsplit.c
merge-base.c standardize usage info string format 2015-01-14 09:32:04 -08:00
merge-file.c Merge branch 'ab/merge-file-prefix' 2015-02-22 12:28:25 -08:00
merge-index.c standardize usage info string format 2015-01-14 09:32:04 -08:00
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'jc/merge' 2015-05-19 13:17:57 -07:00
mktag.c
mktree.c
mv.c standardize usage info string format 2015-01-14 09:32:04 -08:00
name-rev.c standardize usage info string format 2015-01-14 09:32:04 -08:00
notes.c standardize usage info string format 2015-01-14 09:32:04 -08:00
pack-objects.c Merge branch 'jk/sha1-file-reduce-useless-warnings' 2015-05-11 14:23:41 -07:00
pack-redundant.c standardize usage info string format 2015-01-14 09:32:04 -08:00
pack-refs.c standardize usage info string format 2015-01-14 09:32:04 -08:00
patch-id.c patch-id: convert to use struct object_id 2015-03-13 22:43:14 -07:00
prune-packed.c standardize usage info string format 2015-01-14 09:32:04 -08:00
prune.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
push.c push: allow --follow-tags to be set by config push.followTags 2015-03-14 15:08:35 -07:00
read-tree.c
receive-pack.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
reflog.c reflog: improve and update documentation 2015-03-05 12:35:36 -08:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
repack.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
replace.c ref_transaction_update(): remove "have_old" parameter 2015-02-17 11:22:50 -08:00
rerere.c standardize usage info string format 2015-01-14 09:32:04 -08:00
reset.c
rev-list.c
rev-parse.c Merge branch 'nd/multiple-work-trees' 2015-05-11 14:23:39 -07:00
revert.c standardize usage info string format 2015-01-14 09:32:04 -08:00
rm.c use file_exists() to check if a file exists in the worktree 2015-05-20 13:49:10 -07:00
send-pack.c send-pack.c: add --atomic command line argument 2015-01-07 19:56:44 -08:00
shortlog.c standardize usage info string format 2015-01-14 09:32:04 -08:00
show-branch.c Merge branch 'mh/show-branch-topic' 2015-05-05 21:00:26 -07:00
show-ref.c standardize usage info string format 2015-01-14 09:32:04 -08:00
stripspace.c
symbolic-ref.c standardize usage info string format 2015-01-14 09:32:04 -08:00
tag.c Merge branch 'jk/tag-h-column-is-a-listing-option' into maint 2015-03-27 13:00:23 -07:00
unpack-file.c
unpack-objects.c
update-index.c Merge branch 'nd/untracked-cache' 2015-05-26 13:24:46 -07:00
update-ref.c ref_transaction_verify(): new function to check a reference's value 2015-02-17 11:24:59 -08:00
update-server-info.c
upload-archive.c
var.c
verify-commit.c standardize usage info string format 2015-01-14 09:32:04 -08:00
verify-pack.c standardize usage info string format 2015-01-14 09:32:04 -08:00
verify-tag.c standardize usage info string format 2015-01-14 09:32:04 -08:00
write-tree.c