Re: [PATCH v5 01/35] pkt-line: introduce packet_read_with_status

2018-03-15 Thread Junio C Hamano
Brandon Williams writes: >> EOF was -1 and NORMAL was 0 in the previous round; do we need to >> read through all the invocations of functions that return this type >> and make sure there is no "while (such_a_function())" that used to see >> if we read NORMAL that is left

Re: [PATCH v5 01/35] pkt-line: introduce packet_read_with_status

2018-03-15 Thread Brandon Williams
On 03/14, Junio C Hamano wrote: > Brandon Williams writes: > > > +/* > > + * Read a packetized line into a buffer like the 'packet_read()' function > > but > > + * returns an 'enum packet_read_status' which indicates the status of the > > read. > > + * The number of bytes

Re: [PATCH v5 01/35] pkt-line: introduce packet_read_with_status

2018-03-14 Thread Junio C Hamano
Brandon Williams writes: > +/* > + * Read a packetized line into a buffer like the 'packet_read()' function but > + * returns an 'enum packet_read_status' which indicates the status of the > read. > + * The number of bytes read will be assigined to *pktlen if the status of

[PATCH v5 01/35] pkt-line: introduce packet_read_with_status

2018-03-14 Thread Brandon Williams
The current pkt-line API encodes the status of a pkt-line read in the length of the read content. An error is indicated with '-1', a flush with '0' (which can be confusing since a return value of '0' can also indicate an empty pkt-line), and a positive integer for the length of the read content