Re: [PATCH v2 3/5] pkt-line: extract and use `set_packet_header` function
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- Jul 27, 2016, 09:13 UTC
- Message-ID
- <A6E129CE-26F9-456A-B9C7-A502245DD19E@gmail.com>
- In-Reply-To
- <xmqqinvsx77w.fsf@gitster.mtv.corp.google.com>
Show 12 quoted lines
> On 27 Jul 2016, at 02:20, Junio C Hamano <gitster@pobox.com> wrote: > > larsxschneider@gmail.com writes: > >> From: Lars Schneider <larsxschneider@gmail.com> >> >> `set_packet_header` converts an integer to a 4 byte hex string. Make >> this function publicly available so that other parts of Git can easily >> generate a pkt-line. > > I think that having to do this is a strong sign that the design of > this series is going in a wrong direction.
Thanks for the feedback. Do you think using "pkt-line" is a move into the wrong direction in general or do you think only my usage of "pkt-line" is not ideal?
Show 9 quoted lines
> If you need a helper function that writes a pkt-line format that > behaves differently from what is already available (for example, > packet_write()), it would be much better to design that new function > so that it would be generally useful and add that to pkt-line.[ch], > instead of creating random helper functions that use write(2) > directly, bypassing pkt-line API, to write stuff. > > In other words, do not _mimick_ pkt-line; enhance pkt-line as > necessary and use it.
OK, I understand your argument. If we agree on the "pkt-line" usage then I will address this issue.
Thanks, Lars