Re: [PATCH v5 1/6] last-modified: new subcommand to show when files were last modified
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 1, 2025, 16:59 UTC
- Message-ID
- <xmqqh5yrm0z9.fsf@gitster.g>
- In-Reply-To
- <CAP8UFD18Ds4zME_ZHRdTA0W7KXk57zo9664xaU2TbH7YsHbFUg@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 12 quoted lines
> On Fri, Jul 18, 2025 at 2:02 AM Taylor Blau <me@ttaylorr.com> wrote:
>
>> > +struct last_modified {
>> > + struct hashmap paths;
>> > + struct rev_info rev;
>> > + int recursive, tree_in_recursive;
>>
>> Can we either make these two part of a bitfield, or at least declare
>> them separately?
>
> I wonder if we could/should use the `bool` type from <stdbool.h> as
> Documentation/CodingGuidelines says that it's now allowed.Even though "allowed" is different from "encouraged", I would say it is a good idea to declare them separately, i.e.
bool recursive; bool show_trees_in_recursive;
I am guessing 'tree-in-recursive' is one similar to 'git ls-tree -t' feature but the name given in the patch requires such guessing, as the name is a bit inadequate (it does not say what you want to do to trees when recursive).
Renaming to show_trees_in_recursive eliminates the need for such guessing. The implementation of ls-tree calls the corresponding but as LS_SHOW_TREES which is a bit inadequate.