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, 15:58 UTC
Message-ID
<xmqqecngjp87.fsf@gitster.g>
In-Reply-To
<13ff1d94-401e-4fa7-b247-fe8396ca9970@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
Show 19 quoted lines
> Am 22.01.26 um 23:15 schrieb Derrick Stolee:
>> Unfortunately, it also says "print a minimal subset" which in some
>> sense is correct by "it cannot be made smaller without losing
>> information" but we actually choose the maximal set there, not a
>> minimal set.
>> ...
>> You are presenting interesting overlaps of terminology and needs.
>> One thing that is different about 'git rev-list --maximal-only' with
>> a list of starting commits is that it wants the maximal set from
>> the _union_ of the histories, instead of the _intersection_ like
>> 'git merge-base --independent' does.
>
> I don't quite understand how a union or intersection come into play
> here. The difference between the two is that `git rev-list
> --maximal-only` permits negative revisions as input, but `git merge-base
> --independent` does not. In the case where the input is only positive
> revisions, the result of --maximal-only should always be exactly
> identical to --independent, right? Even if the revisions are on
> disconnected histories?

Ahh, it is an ancient history that I forgot how the command worked. "merge-base --independent A B C" does not do any "merge-base" computation over the commits A B C and shows the ones that cannot be reached from any other. If it were to compute merge bases across these commits and then find commits, among the computed merge bases, that cannot be reached from any other merge bases, "intersection" might come into play, but I do not think that is what the command does.

Previous: Johannes SixtNext: Derrick Stolee
Message 14 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.