From: Patrick Steinhardt Date: Mon, 11 May 2026 12:04:23 GMT Subject: Re: [PATCH v3] commit-reach: early exit paint_down_to_common for single merge-base Message-ID: In-Reply-To: On Mon, May 11, 2026 at 11:22:12AM +0000, Kristofer Karlsson via GitGitGadget wrote: > Changes since v2 (thanks Patrick for the suggestion): > > * Replaced the boolean find_all and ignore_missing_commits parameters > in paint_down_to_common() with a single enum merge_base_flags > mb_flags, reducing the function from 8 to 7 parameters. The enum is > defined in commit-reach.h with MERGE_BASE_FIND_ALL and > MERGE_BASE_IGNORE_MISSING_COMMITS. > > * Named the enum merge_base_flags rather than > paint_down_to_common_flags since the flags express caller intent and > are threaded through multiple layers including the public > repo_get_merge_bases_many_dirty() API. > > * Used mb_flags as the parameter name to avoid shadowing the existing > local int flags (commit object flags) inside paint_down_to_common(). Thanks for making these changes. I think it would make sense to split this up into two commits though, where the first commit only introduces the new enum (without the new flag) and the second commit then adds the new flag and the performance optimization. That'd help quite a bit with the review as it splits up the changes into a refactoring-only change without any intended semantic change, and another commit that then does result in a user-visible change. Patrick