git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Derrick StoleeNext: Derrick Stolee
Message 16 of 19 in “revision: add --maximal option”
  1. revision: add --maximal optionDerrick Stolee via GitGitGadget, Jan 18, 2026
  2. Johannes SixtJan 18, 2026
  3. Derrick StoleeJan 18, 2026
  4. Johannes SixtJan 19, 2026
  5. Derrick StoleeJan 19, 2026
  6. Johannes SixtJan 19, 2026
  7. Junio C HamanoJan 20, 2026
  8. Derrick StoleeJan 22, 2026
  9. revision: add --maximal-only optionDerrick Stolee via GitGitGadget, Jan 22, 2026
  10. Junio C HamanoJan 22, 2026
  11. Derrick StoleeJan 22, 2026
  12. Junio C HamanoJan 22, 2026
  13. Johannes SixtJan 23, 2026
  14. Junio C HamanoJan 23, 2026
  15. Derrick StoleeJan 23, 2026
  16. Junio C HamanoJan 23, 2026
  17. Derrick StoleeJan 28, 2026
  18. Junio C HamanoJan 29, 2026
  19. Derrick StoleeJan 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.