Re: [PATCH v4 1/5] [GSOC] ref-filter: add obj-type check in grab contents

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

Re: [PATCH v4 1/5] [GSOC] ref-filter: add obj-type check in grab contents

From: Junio C Hamano <hidden>
Date: 2021-07-26 19:15:31

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

Only tag and commit objects use `grab_sub_body_contents()` to grab
object contents in the current codebase.  We want to teach the
function to also handle blobs and trees to get their raw data,
without parsing a blob (whose contents looks like a commit or a tag)
incorrectly as a commit or a tag. So it's needed to pass a
`struct expand_data *data` instread of only `void *buf` to both
`grab_sub_body_contents()` and `grab_values()` to be able to check
the object type.

Skip the block of code that is specific to handling commits and tags
early when the given object is of a wrong type to help later
addition to handle other types of objects in this function.

Reviewed-by: Jacob Keller <redacted>
Mentored-by: Christian Couder [off-list ref]
Mentored-by: Hariom Verma [off-list ref]
Helped-by: Junio C Hamano [off-list ref]
Signed-off-by: ZheNing Hu <redacted>
It is not a huge deal, but are these trailers given in a sensible
order?  The order of event happened were that help and mentoring
were given, your finished version of the patch came after that to be
signed off by you, and then a reviewer gave you a reviewed-by, no?

Re: [PATCH v4 1/5] [GSOC] ref-filter: add obj-type check in grab contents

From: ZheNing Hu <hidden>
Date: 2021-07-27 01:40:36

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

Only tag and commit objects use `grab_sub_body_contents()` to grab
object contents in the current codebase.  We want to teach the
function to also handle blobs and trees to get their raw data,
without parsing a blob (whose contents looks like a commit or a tag)
incorrectly as a commit or a tag. So it's needed to pass a
`struct expand_data *data` instread of only `void *buf` to both
`grab_sub_body_contents()` and `grab_values()` to be able to check
the object type.

Skip the block of code that is specific to handling commits and tags
early when the given object is of a wrong type to help later
addition to handle other types of objects in this function.

Reviewed-by: Jacob Keller <redacted>
Mentored-by: Christian Couder [off-list ref]
Mentored-by: Hariom Verma [off-list ref]
Helped-by: Junio C Hamano [off-list ref]
Signed-off-by: ZheNing Hu <redacted>
It is not a huge deal, but are these trailers given in a sensible
order?  The order of event happened were that help and mentoring
were given, your finished version of the patch came after that to be
signed off by you, and then a reviewer gave you a reviewed-by, no?
Indeed so.

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