From: Junio C Hamano Date: Wed, 23 Mar 2022 19:54:50 GMT Subject: Re: [PATCH v14 00/15] ls-tree: "--object-only" and "--format" opts Message-ID: In-Reply-To: Teng Long writes: > 8: 55f1e10d7e ! 9: f4fc377dfa ls-tree: slightly refactor `show_tree()` > @@ Metadata > ## Commit message ## > ls-tree: slightly refactor `show_tree()` > > - This is a non-functional change, we use a new int "shown_fields" to mark > - which columns to output, and `parse_shown_fields()` to calculate the > - value of "shown_fields". > + This is a non-functional change, we introduce an enum "ls_tree_cmdmode" > + then use it to mark which columns to output. I think readers will read "non-functional change" as "we changed it and made it not function anymore", but you meant something else ;-) I'll let it pass, though, for the sake of expediency. The series somehow ended up to be unnecessarily longer and more complicated, becoming closer to a complete rewrite of the implementation, compared to the earlier rounds which were more like incremental enhancement. Thanks, will queue. > This has the advantage of making the show_tree logic simpler and more > readable, as well as making it easier to extend new options (for example, > if we want to add a "--object-only" option, we just need to add a similar > + "short-circuit logic in "show_tree()").