Re: [PATCH] tree_entry_interesting: make recursive mode default
From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:52:47
2012/1/12 Junio C Hamano [off-list ref]:
Thanks, but I am curious about two (and a half) things. - The "max_depth" option has perfectly good and natural "invalid" sentinel values (i.e. 0 or negative). Why do we need a separate bitfield?
We want infinite recursion by default, by max_depth default value is 0, which is non-recursive.
- Special casing the non-recursive mode of diff-tree is perfectly acceptable, but nonrecursive_diff_tree does not sound like a very good name for it for two reasons. Perhaps there may be other users that want the "surface only" behaviour, so having "diff_tree" in the name limits its future (re)use. Also an option that is named negatively inevitably invites "if (!opt->non_whatever)" double negative. Can we come up with a better name, perhaps "onelevel_only" or something?
I'm bad at naming, any other names are welcome. onelevel_only sounds good.
- Shouldn't "onelevel_only" be the same as limiting to a single depth with "max_depth"?
I thought of that but not sure it's equivalent to max_depth == 1 or max_depth == 0, so I separated it for safety and clarity. max_depth feature is driven by git-grep and there were a few interpretations how it should behave last time, so I'm not sure if its behavior may change in future. -- Duy