Re: [PATCH v2 2/2] [GSOC] ref-filter: add %(raw) atom
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jun 4, 2021, 13:23 UTC
- Message-ID
- <CAP8UFD3m-=4=a9XX6Nu45+-4QdeNYi54rXgqizR7HrOh_qk8OQ@mail.gmail.com>
- In-Reply-To
- <0efed9435b59098f3ad928acd46c3c7e9f13677d.1622808751.git.gitgitgadget@gmail.com>
On Fri, Jun 4, 2021 at 2:12 PM ZheNing Hu via GitGitGadget <gitgitgadget@gmail.com> wrote:
Show 9 quoted lines
> > From: ZheNing Hu <adlternative@gmail.com> > > Add new formatting option `%(raw)`, which will print the raw > object data without any changes. It will help further to migrate > all cat-file formatting logic from cat-file to ref-filter. > > The raw data of blob, tree objects may contain '\0', but most of > the logic in `ref-filter` depands on the output of the atom being
s/depands/depends/
> text (specifically, no embedded NULs in it).
Show 9 quoted lines
> diff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt > index 2ae2478de706..8f8d8cd1e04f 100644 > --- a/Documentation/git-for-each-ref.txt > +++ b/Documentation/git-for-each-ref.txt > @@ -235,6 +235,15 @@ and `date` to extract the named component. For email fields (`authoremail`, > without angle brackets, and `:localpart` to get the part before the `@` symbol > out of the trimmed email. > > +The raw data in a object is `raw`.
s/a object/an object/
Show 7 quoted lines
> + > +raw:size:: > + The raw data size of the object. > + > +Note that `--format=%(raw)` can not be used with `--python`, `--shell`, `--tcl`, > +`--perl` because the host language may not support arbitrary binary data in the > +variables of its string type.
Show 6 quoted lines
> @@ -1765,7 +1815,7 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err) > int deref = 0; > const char *refname; > struct branch *branch = NULL; > - > + v->s_size = ATOM_VALUE_S_SIZE_INIT;
It looks like a blank line was removed as you added the above new line.
> v->handler = append_atom; > v->atom = atom; >