Re: [PATCH 14/15] [GSOC] cat-file: re-implement --textconv, --filters options

2 messages, 2 authors, 2021-07-02 · open the first message on its own page

Re: [PATCH 14/15] [GSOC] cat-file: re-implement --textconv, --filters options

From: Junio C Hamano <hidden>
Date: 2021-07-01 20:11:23

"ZheNing Hu via GitGitGadget" [off-list ref] writes:
From: ZheNing Hu <redacted>

After cat-file reuses the ref-filter logic, we re-implement the
functions of --textconv and --filters options.

Add members `use_textconv` and `use_filters` in struct `ref_format`,
and use global variables `use_filters` and `use_textconv` in
`ref-filter.c`, so that we can filter the content of the object
in get_object().
These global variables are problematic.  The places that check them
are quite isolated, and it makes me wonder why we cannot pass a
format instance through the callchain down to get_object().

 

Re: [PATCH 14/15] [GSOC] cat-file: re-implement --textconv, --filters options

From: ZheNing Hu <hidden>
Date: 2021-07-02 12:46:23

Junio C Hamano [off-list ref] 于2021年7月2日周五 上午4:11写道:
"ZheNing Hu via GitGitGadget" [off-list ref] writes:
quoted
From: ZheNing Hu <redacted>

After cat-file reuses the ref-filter logic, we re-implement the
functions of --textconv and --filters options.

Add members `use_textconv` and `use_filters` in struct `ref_format`,
and use global variables `use_filters` and `use_textconv` in
`ref-filter.c`, so that we can filter the content of the object
in get_object().
These global variables are problematic.  The places that check them
are quite isolated, and it makes me wonder why we cannot pass a
format instance through the callchain down to get_object().
If we pass such two options In such a deep call chain, it seems not
worth to do it.

format_ref_array_item()->get_ref_atom_value()->populate_value()-->get_object()

But if we puts them in struct ref_array_item, It may be a solution,
but it may not be
very good.

Or just use "static" prefix?
Thanks.
--
ZheNing Hu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help