• J
    cat-file: add --batch-check=<format> · 93d2a607
    Jeff King 提交于
    The `cat-file --batch-check` command can be used to quickly
    get information about a large number of objects. However, it
    provides a fixed set of information.
    
    This patch adds an optional <format> option to --batch-check
    to allow a caller to specify which items they are interested
    in, and in which order to output them. This is not very
    exciting for now, since we provide the same limited set that
    you could already get. However, it opens the door to adding
    new format items in the future without breaking backwards
    compatibility (or forcing callers to pay the cost to
    calculate uninteresting items).
    
    Since the --batch option shares code with --batch-check, it
    receives the same feature, though it is less likely to be of
    interest there.
    
    The format atom names are chosen to match their counterparts
    in for-each-ref. Though we do not (yet) share any code with
    for-each-ref's formatter, this keeps the interface as
    consistent as possible, and may help later on if the
    implementations are unified.
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    93d2a607
cat-file.c 8.5 KB