Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
Register now
git-rev-list: Implement option to only print missing object
In the [partial clone demo](https://gitlab.com/chriscool/partial-clone-demo/-/blob/master/http-promisor/demo.txt#L37) we use the following command to count the missing objects: ```sh git -C git-client1 rev-list --objects --all --missing=print | perl -ne 'print if s/^[?]//' | wc -l ``` Using `--missing=print` will print the missing objects, but prepend the hash with a `?`. Output will look something like this: ``` git -C git-client1 rev-list --objects --all --missing=print <snip> 997343e133b42a08059584766e2737632c9c044e read-tree.c 2b5bfdf7798569e0b59b16eb9602d5fa572d6038 74a0a234dd346fff51c773aa57d82fc4b83a8557 cat-file.c 840307af0cfaab31555795ce7175d5e9c9f981a0 commit-tree.c 25dc13fe101b219f74007f3194b787dd99e863da init-db.c c924a6e0fc4c36bad6f23cb87ee59518c771f936 read-cache.c 1b47742d8cbc0d98903777758b7b519980e7499e read-tree.c b8522886a15db861508fb6d03d4d88d6de912a4b show-diff.c 5085a5cb53ee52e1886ff6d46c609bdb2fc6d6cd update-cache.c 921f981353229db0c56103a52609d35aff16f41b write-tree.c ?26c66ca7b2eb8bca263ca909c9c48434d0d279f4 ?e446c76d99233e5390832957b890e0c06e859172 ?a189b16dc4750d70d360d33d435dd676312f2928 ?814d40a962ca14e7b28e70bca272364102b261ba ?9fcf8aa54302d184a2e5463484a9f17315bb1e6f ?79903137a44b599a96888ffa98e8c75217ce33d7 ?b891f3b20b0c28b4cc32aa5b97732e0a54e70249 ?e1d10db68804f2870b0f8cb55cabb47bfd60a45a ?079266398882a970242daaab4c53956da2a3f2b6 ?3d52d247e891c09b6e0e9c5f05ae60790edf2c2e ?69d54e9374d350f8c2b573403da7f7c63b45bdca ?26998105879cc2113cb8e5dfed2bdec02820ab48 ?5459484048adde7d1563ad22adba1a759e7b7e59 ?125ba9640c430d3f7379970f5d6fd1b00414251b ?bb9c9ba37c07414e5e9ca092566500aa4a9ead87 ?d85e6f5da9ccc107bf42c730117fe6f51e2d5f26 ?6e25be73962a6edb79d75ba29745105ce40cc94d ?ed66936e6f58736b6941aba72879fdd9b90d2581 ?d72d5b5dccfe69e0300552850bc32f36d06bd5e7 ?c2af08224f842b488663e592d6e2032bffdaa03e ?d730cf11417ec50caeb5b1f54c27e8b1c54d56c8 <snip> ``` Ideally there would be a command line option to only print the missing objects. ### Proposal Add an optional argument `--print-only-missing` that only prints missing objects.
issue