Re: [PATCH v2] revision: add --maximal-only option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 23, 2026, 18:08 UTC
- Message-ID
- <xmqqfr7wgq1p.fsf@gitster.g>
- In-Reply-To
- <f363c16c-1c36-4485-b1e9-22abe32b3a25@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
> Interesting. Thanks for the correction. So we _do_ have a way to > get this information for a range that doesn't have negative refs > or other custom walk modifiers (and this implementation would be > faster for this case).
Perhaps. If so, perhaps we can improve --maximal-only (and possibly rename it to --independent? I dunno about this part) by special casing the logic, and then steer people to use the new implementation that can use negative ends, deprecating "merge-base --independent" (which was written to be a better "show-branch --independent")?
> My patch includes test cases that are not covered by the > merge-base command. I don't think it would be valuable to extend > the merge-base command with even more cases that don't actually > output merge-bases / intersections.
Yup, I do not think show-branch nor merge-base were good home for the feature. We only needed to make reduce_heads_replace() available somewhere, and "git show --maximal-only A B C" might be a much better way to express "show only the independent ones", as it would allow using all kinds of output options the "log" family of commands support.