In order to let git cat-file --batch reuse ref-filter logic, the atom %(rest) and %(raw) are added to ref-filter. Change from last version: Use printf "xxx" instead of printf "%b" "xxx" in test, ensure that strings containing NUL will not be truncated, to avoid the breakage of the test. ZheNing Hu (4): [GSOC] ref-filter: add obj-type check in grab contents [GSOC] ref-filter: add %(raw) atom [GSOC] ref-filter: use non-const ref_format in *_atom_parser() [GSOC] ref-filter: add %(rest) atom Documentation/git-for-each-ref.txt | 9 ++ builtin/tag.c | 2 +- ref-filter.c | 226 +++++++++++++++++++++-------- ref-filter.h | 9 +- t/t3203-branch-output.sh | 4 + t/t6300-for-each-ref.sh | 211 +++++++++++++++++++++++++++ t/t7004-tag.sh | 4 + t/t7030-verify-tag.sh | 4 + 8 files changed, 408 insertions(+), 61 deletions(-) base-commit: 1197f1a46360d3ae96bd9c15908a3a6f8e562207 Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-976%2Fadlternative%2Fref-filter-texconv-filters-v2-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-976/adlternative/ref-filter-texconv-filters-v2-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/976 Range-diff vs v1: 1: 48d256db5c34 = 1: 48d256db5c34 [GSOC] ref-filter: add obj-type check in grab contents 2: 428d105ebbad ! 2: abee6a03becb [GSOC] ref-filter: add %(raw) atom @@ t/t6300-for-each-ref.sh: test_atom refs/myblobs/first contents:body "" +' + +test_expect_success 'set up refs pointing to binary blob' ' -+ printf "%b" "a\0b\0c" >blob1 && -+ printf "%b" "a\0c\0b" >blob2 && -+ printf "%b" "\0a\0b\0c" >blob3 && -+ printf "%b" "abc" >blob4 && -+ printf "%b" "\0 \0 \0 " >blob5 && -+ printf "%b" "\0 \0a\0 " >blob6 && -+ printf "%b" " " >blob7 && ++ printf "a\0b\0c" >blob1 && ++ printf "a\0c\0b" >blob2 && ++ printf "\0a\0b\0c" >blob3 && ++ printf "abc" >blob4 && ++ printf "\0 \0 \0 " >blob5 && ++ printf "\0 \0a\0 " >blob6 && ++ printf " " >blob7 && + >blob8 && + git hash-object blob1 -w | xargs git update-ref refs/myblobs/blob1 && + git hash-object blob2 -w | xargs git update-ref refs/myblobs/blob2 && 3: e4a5aeec0409 = 3: c99d1d070a18 [GSOC] ref-filter: use non-const ref_format in *_atom_parser() 4: 5e95292e3de2 = 4: 5a5b5f78aeea [GSOC] ref-filter: add %(rest) atom -- gitgitgadget