1. 13 7月, 2013 1 次提交
    • 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
  2. 12 7月, 2013 3 次提交
  3. 08 7月, 2013 2 次提交
    • J
      teach sha1_object_info_extended a "disk_size" query · 161f00e7
      Jeff King 提交于
      Using sha1_object_info_extended, a caller can find out the
      type of an object, its size, and information about where it
      is stored. In addition to the object's "true" size, it can
      also be useful to know the size that the object takes on
      disk (e.g., to generate statistics about which refs consume
      space).
      
      This patch adds a "disk_sizep" field to "struct object_info",
      and fills it in during sha1_object_info_extended if it is
      non-NULL.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      161f00e7
    • J
      zero-initialize object_info structs · 7c07385d
      Jeff King 提交于
      The sha1_object_info_extended function expects the caller to
      provide a "struct object_info" which contains pointers to
      "query" items that will be filled in. The purpose of
      providing pointers rather than storing the response directly
      in the struct is so that callers can choose not to incur the
      expense in finding particular fields that they do not care
      about.
      
      Right now the only query item is "sizep", and all callers
      set it explicitly to choose whether or not to query it; they
      can then leave the rest of the struct uninitialized.
      
      However, as we add new query items, each caller will have to
      be updated to explicitly turn off the new ones (by setting
      them to NULL).  Instead, let's teach each caller to
      zero-initialize the struct, so that they do not have to
      learn about each new query item added.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7c07385d
  4. 25 5月, 2013 1 次提交
  5. 22 5月, 2013 3 次提交
  6. 21 5月, 2013 5 次提交
  7. 18 5月, 2013 8 次提交
  8. 17 5月, 2013 4 次提交
  9. 16 5月, 2013 9 次提交
  10. 15 5月, 2013 1 次提交
  11. 14 5月, 2013 1 次提交
  12. 13 5月, 2013 2 次提交