mbox series

[0/2,GSOC] ref-filter: add %(raw) atom

Message ID pull.963.git.1622126603.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series ref-filter: add %(raw) atom | expand

Message

John Cai via GitGitGadget May 27, 2021, 2:43 p.m. UTC
In order to make git cat-file --batch use ref-filter logic, I add %(raw)
atom to ref-filter.

Change from last version:

 1. In my discussion with Junio, I came to the conclusion that
    --format="%(raw)" should not be used with --python, --perl, --shell,
    --tcl. Therefore, die if both --format="%(raw)" and

--language are given in parse_ref_filter_atom(). The reason I don't move
this part to raw_atom_parser() is if I move it to raw_atom_parser(), when we
use:

git --format=%raw --sort=raw --python`

Git will continue to run instead of die because parse_sorting_atom() will
use a dummy ref_format and don't remember --language details, next time
format_ref_array_item() will reuse the used_atom entry of sorting atom in
parse_ref_filter_atom(), This will skip the check in raw_atom_parser(). 2.
Give atom_value.s_size a init value ATOM_VALUE_S_SIZE_INIT (-1), which can
help us distinguish an object whose length is 0 and an object whose s_size
has not been modified after initialization. 3. Add %(header) atom.

ZheNing Hu (2):
  [GSOC] ref-filter: add %(raw) atom
  [GSOC] ref-filter: add %(header) atom

 Documentation/git-for-each-ref.txt |  21 +++
 ref-filter.c                       | 182 ++++++++++++++++++----
 t/t6300-for-each-ref.sh            | 236 +++++++++++++++++++++++++++++
 3 files changed, 412 insertions(+), 27 deletions(-)


base-commit: 5d5b1473453400224ebb126bf3947e0a3276bdf5
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-963%2Fadlternative%2Fref-filter-raw-atom-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-963/adlternative/ref-filter-raw-atom-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/963

Comments

Felipe Contreras May 27, 2021, 3:39 p.m. UTC | #1
ZheNing Hu via GitGitGadget wrote:
> In order to make git cat-file --batch use ref-filter logic, I add %(raw)
> atom to ref-filter.
> 
> Change from last version:
> 
>  1. In my discussion with Junio, I came to the conclusion that
>     --format="%(raw)" should not be used with --python, --perl, --shell,
>     --tcl. Therefore, die if both --format="%(raw)" and
> 
> --language are given in parse_ref_filter_atom(). The reason I don't move
> this part to raw_atom_parser() is if I move it to raw_atom_parser(), when we
> use:
> 
> git --format=%raw --sort=raw --python`

Missing the command I presume (and the other backtick).