Re: [PATCH v3 01/13] graph: automatically track display width of graph lines

2019-10-15 Thread Junio C Hamano
Junio C Hamano writes: >> int graph_next_line(struct git_graph *graph, struct strbuf *sb) > > I just noticed it but does this have to be extern? Nobody outside > graph.[ch] seems to have any reference to it. I was stupid; strike this part out. Thanks.

Re: [PATCH v3 01/13] graph: automatically track display width of graph lines

2019-10-15 Thread Junio C Hamano
"James Coglan via GitGitGadget" writes: > +struct graph_line { > + struct strbuf *buf; > + size_t width; > +}; > + > +static inline void graph_line_addch(struct graph_line *line, int c) > +{ > + strbuf_addch(line->buf, c); > + line->width++; > +} > + > +static inline void graph_li

[PATCH v3 01/13] graph: automatically track display width of graph lines

2019-10-15 Thread James Coglan via GitGitGadget
From: James Coglan All the output functions called by `graph_next_line()` currently keep track of how many printable chars they've written to the buffer, before calling `graph_pad_horizontally()` to pad the line with spaces. Some functions do this by incrementing a counter whenever they write to