Subject: [PATCH 00/19] [GSOC] cat-file: reuse ref-filter logic

From: "ZheNing Hu via GitGitGadget" <[email-masked]>
Date: Mon, 12 Jul 2021 11:46:40 +0000

This patch series make cat-file reuse ref-filter logic.

Change from last version:

 1. Declare buf_size in if (atom_type == ATOM_RAW) block.
 2. Modify the code style of the test.
 3. Delete "use_textconv" and "use_filter" flag. Instead, add member
    cat_file_cmdmode to struct ref_array_item.
 4. Add function reject_atom() to enhance the readability of the code.
 5. Create p1006-cat-file.sh for performance regression testing.
 6. Use a "fast path" to output object data to reduce the performance
    degradation of cat-file --batch with the suggest of Ævar Arnfjörð
    Bjarmason.

ZheNing Hu (19):
  cat-file: handle trivial --batch format with --batch-all-objects
  cat-file: merge two block into one
  [GSOC] ref-filter: add obj-type check in grab contents
  [GSOC] ref-filter: add %(raw) atom
  [GSOC] ref-filter: --format=%(raw) re-support --perl
  [GSOC] ref-filter: use non-const ref_format in *_atom_parser()
  [GSOC] ref-filter: add %(rest) atom
  [GSOC] ref-filter: pass get_object() return value to their callers
  [GSOC] ref-filter: introduce free_ref_array_item_value() function
  [GSOC] ref-filter: introduce reject_atom()
  [GSOC] ref-filter: modify the error message and value in get_object
  [GSOC] cat-file: add has_object_file() check
  [GSOC] cat-file: change batch_objects parameter name
  [GSOC] cat-file: reuse ref-filter logic
  [GSOC] cat-file: reuse err buf in batch_object_write()
  [GSOC] cat-file: re-implement --textconv, --filters options
  [GSOC] ref-filter: remove grab_oid() function
  [GSOC] cat-file: create p1006-cat-file.sh
  [GSOC] cat-file: use fast path when using default_format

 Documentation/git-cat-file.txt     |   6 +
 Documentation/git-for-each-ref.txt |   9 +
 builtin/cat-file.c                 | 308 +++++++++----------------
 builtin/tag.c                      |   2 +-
 quote.c                            |  17 ++
 quote.h                            |   1 +
 ref-filter.c                       | 346 +++++++++++++++++++++--------
 ref-filter.h                       |  13 +-
 t/perf/p1006-cat-file.sh           |  28 +++
 t/t1006-cat-file.sh                | 273 +++++++++++++++++++++++
 t/t3203-branch-output.sh           |   4 +
 t/t6300-for-each-ref.sh            | 235 ++++++++++++++++++++
 t/t6301-for-each-ref-errors.sh     |   2 +-
 t/t7004-tag.sh                     |   4 +
 t/t7030-verify-tag.sh              |   4 +
 15 files changed, 955 insertions(+), 297 deletions(-)
 create mode 100755 t/perf/p1006-cat-file.sh

base-commit: d486ca60a51c9cb1fe068803c3f540724e95e83a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-993%2Fadlternative%2Fcat-file-batch-refactor-2-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-993/adlternative/cat-file-batch-refactor-2-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/993
-- 
gitgitgadget