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

Re: [PATCH] revision: add --maximal option

From
Derrick Stolee <stolee@gmail.com>
Date
Jan 19, 2026, 16:44 UTC
Message-ID
<3fab80c8-f602-44d5-8e7d-436982a5e3a8@gmail.com>
In-Reply-To
<1ce18cac-f988-4741-b9dd-6c1cf2d4e6af@kdbg.org>
On 1/19/2026 6:15 AM, Johannes Sixt wrote:
Show 20 quoted lines
> Am 18.01.26 um 19:27 schrieb Derrick Stolee:
>> On 1/18/26 4:05 AM, Johannes Sixt wrote:
>>> Am 18.01.26 um 03:34 schrieb Derrick Stolee via GitGitGadget:
>>>> The option name is too generic IMHO. How about "--starting-point",
>>> "--topmost-only"?  It's function is somewhat parallel to --boundary, but
>>> at the positive end of the revision range. Perhaps we can use that as
>>> inspiration.
>>
>> My perspective is skewed, because "maximal" is a concrete term in the
>> world of partially-ordered sets (such as commit history ordered by
>> reachability across child-to-parent relationships). It's important to
>> distinguish from "starting points" because the inputs to the command
>> are a list of starting points, not all of which are maximal within the
>> set. In fact, if some positive starting points are reachable from the
>> negative starting points, then they are already excluded.
> 
> AFAICS, we don't have options named after graph- or set-theoretical
> terms, but tend to stick to terms established in the Git ecosystem. I
> assume that "maximal" isn't a meaning that an average Git user would
> associate with the operation that is performed here.

My mindset is usually "all words are made up by somebody" and since there isn't an established term for this in the existing Git ecosystem, it is up to us to create a term. Borrowing one that exists elsewhere is a valuable way to build upon any context that term brings with it.

It is also helpful that the term has an explicit technical definition that means exactly what we're using it for here. It explicitly differentiates from any "maximum" or confusion with a collapse to a total order (such as Git's --date-order or --topo-order apply).

> But even if we decide to use "maximal", the option must be named
> something other than *just* "--maximal"; this is simply too generic.
> Perhaps "--only-maximal" or "--maximal-only".
When the argument is moved in the documentation into the set of
filters, then the fact that --maximal restricts the set of commits
makes any modifier such as "only" redundant.
 
Show 6 quoted lines
> Other ideas:
> - --hide-reachable
> - --range-head
> - --range-head-only
> - --most-recent
> - --most-recent-only

These all have issues, such as being technically wrong (maximal commits are reachable) or imply total orders, date orders, or generally only a single result.

Show 8 quoted lines
>> [--maximal]'s interaction with
>> --boundary is trivial because no boundary commits would be included as
>> they are necessarily reachable from a maximal commit.
> 
> So, --boundary --maximal shows only the maximal commits? That sounds
> unexpected. Boundary commits are shown with additional mark-up; they
> don't need to be suppressed. But in a first iteration it's probably
> better to just make the two options incompatible.

Sure. But I'd like to counter that filters like --author also restrict the set, including not showing boundary commits that don't fit the --author pattern. It just happens that no boundary commits are also maximal by definition.

I do sense that a lot of this is a matter of taste, and that you and I differ greatly in our tastes on this topic. I look forward to more opinions that can lead us towards one side or another (or in a new direction).

Thanks, -Stolee

Previous: Johannes SixtNext: Johannes Sixt
Message 5 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.