Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-05 Thread Junio C Hamano
On Fri, Aug 5, 2016 at 10:31 AM, Lars Schneider wrote: > >> On 04 Aug 2016, at 18:14, Junio C Hamano wrote: >> >> signature would look more like write(2) and deserve to be called >> packet_write() but unfortunately the name is taken by what should >>

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-05 Thread Lars Schneider
> On 04 Aug 2016, at 18:14, Junio C Hamano wrote: > > Jeff King writes: > >> The cost of write() may vary on other platforms, but the cost of memcpy >> generally shouldn't. So I'm inclined to say that it is not really worth >> micro-optimizing the interface.

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-05 Thread Junio C Hamano
Lars Schneider writes: > However, besides the bogus performance argument I introduced that function > to allow packet writs to fail using the `gentle` parameter: > http://public-inbox.org/git/D116610C-F33A-43DA-A49D-0B33958822E5%40gmail.com/ > > Would you be OK if I

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-05 Thread Lars Schneider
> On 04 Aug 2016, at 18:14, Junio C Hamano wrote: > > Jeff King writes: > >> The cost of write() may vary on other platforms, but the cost of memcpy >> generally shouldn't. So I'm inclined to say that it is not really worth >> micro-optimizing the interface.

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-04 Thread Junio C Hamano
Jeff King writes: > The cost of write() may vary on other platforms, but the cost of memcpy > generally shouldn't. So I'm inclined to say that it is not really worth > micro-optimizing the interface. > > I think the other issue is that format_packet() only lets you send > string

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-03 Thread Lars Schneider
> On 03 Aug 2016, at 22:18, Junio C Hamano wrote: > > larsxschnei...@gmail.com writes: > >> From: Lars Schneider >> >> set_packet_header() converts an integer to a 4 byte hex string. Make >> this function locally available so that other pkt-line

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-03 Thread Jeff King
On Wed, Aug 03, 2016 at 05:12:21PM -0400, Jeff King wrote: > The alternative is to hand-code it, which is what send_sideband() does > (it uses xsnprintf("%04x") to do the hex formatting, though). After seeing that, I wondered why we need set_packet_header() at all. But we do for the case when we

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-03 Thread Jeff King
On Wed, Aug 03, 2016 at 01:18:55PM -0700, Junio C Hamano wrote: > larsxschnei...@gmail.com writes: > > > From: Lars Schneider > > > > set_packet_header() converts an integer to a 4 byte hex string. Make > > this function locally available so that other pkt-line

Re: [PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-03 Thread Junio C Hamano
larsxschnei...@gmail.com writes: > From: Lars Schneider > > set_packet_header() converts an integer to a 4 byte hex string. Make > this function locally available so that other pkt-line functions can > use it. Didn't I say that this is a bad idea already in an earlier

[PATCH v4 01/12] pkt-line: extract set_packet_header()

2016-08-03 Thread larsxschneider
From: Lars Schneider set_packet_header() converts an integer to a 4 byte hex string. Make this function locally available so that other pkt-line functions can use it. Signed-off-by: Lars Schneider --- pkt-line.c | 18 -- 1