On Mon, Feb 12, 2018 at 08:08:54AM +0000, Olga Telezhnaya wrote:

> Continue migrating formatting logic from cat-file to ref-filter.
> Reuse parse_ref_filter_atom() for unifying all processes in ref-filter
> and further removing of mark_atom_in_object_info().

OK, now it looks we're moving in a good direction.

One thing that puzzles me:

> @@ -401,20 +420,14 @@ static int is_atom(const char *atom, const char *s, int 
> slen)
>  static void mark_atom_in_object_info(const char *atom, int len,
>                                   struct expand_data *data)
>  {
> -     if (is_atom("objectname", atom, len))
> -             ; /* do nothing */
> -     else if (is_atom("objecttype", atom, len))
> +     if (is_atom("objecttype", atom, len))
>               data->info.typep = &data->type;
>       else if (is_atom("objectsize", atom, len))
>               data->info.sizep = &data->size;
> -     else if (is_atom("objectsize:disk", atom, len))
> -             data->info.disk_sizep = &data->disk_size;
>       else if (is_atom("rest", atom, len))
>               data->split_on_whitespace = 1;
>       else if (is_atom("deltabase", atom, len))
>               data->info.delta_base_sha1 = data->delta_base_oid.hash;
> -     else
> -             die("unknown format element: %.*s", len, atom);
>  }

Why do some of these atoms go away and not others? It seems like we're
now relying on ref-filter to parse some of the common ones using its
existing atom-parser. But wouldn't it have objecttype and objectsize
already, then?

-Peff

Reply via email to