Re: [PATCH 2/8] fetch: move reference width calculation into `display_state`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 15, 2023, 20:59 UTC
- Message-ID
- <xmqqedppohno.fsf@gitster.g>
- In-Reply-To
- <aa792b12a468263d05e8615d4b3691ed8fe823ff.1678878623.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 8 quoted lines
> In order to print references in proper columns we need to calculate the > width of the reference column before starting to print the references. > This is done with the help of a global variable `refcol_width`. > > Refactor the code to instead use a new structure `display_state` that > contains the computed width and plumb it through the stack as required. > This is only the first step towards de-globalizing the state required to > print references.
Nice.
Given that in the previous step, what used to be called display got renamed to display_buffer (I think "buffer" ought to be sufficient in this context, though), the variable of "struct display_state" type should NOT be named "display", as it would be confusing when two things are related to "display" and only one of them is called as such. Either "display_state" or "state" would be fine.
Thanks.