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

Re: [PATCH] Add --only-merges flag to display only merge commits.

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 9, 2008, 20:06 UTC
Message-ID
<7v3apu6bes.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080408203648.GS11574@genesis.frugalware.org>
Miklos Vajna <vmiklos@frugalware.org> writes:
Show 5 quoted lines
> This is the opposite of git-rev-list --no-merges: It will hide commits
> with single or no parent.
>
> It is useful if a maintainer has a lot of commits between tags and
> usually each feature is developed in its own topic branch.

For that particular use case, I'd suggest --first-parent. It is not just about filtering the output but more importantly also affects the way the traversal is done (it does not descend into side branches). It simply is more suited for the job you described.

At this point, I have a mild aversion to a random addition to rev-list that does not have to affect how the traversal works but only filters the output, and more importantly does only a single purpose filtering.

It is very much unclear if the --only-merges is a very common thing for people to want to do, and it is very clear what --only-merges does is a very narrow single purpose filtering.

Contrast that to existing --no-merges or --grep. The former is a very narrow single purpose filtering but it is clearly something everybody would want to have. The latter also satisfies a common desire, and it is an easy way to query with a customized filtering, e.g. you can use it like so: 'log --grep="Merge " v1.5.4..v1.5.5'.

Previous: Miklos VajnaNext: Miklos Vajna
Message 6 of 7 in “Add --only-merges flag to display only merge commits.”
  1. Add --only-merges flag to display only merge commits.Miklos Vajna, Apr 8, 2008
  2. Johannes SchindelinApr 9, 2008
  3. Miklos VajnaApr 9, 2008
  4. Johannes SchindelinApr 9, 2008
  5. Miklos VajnaApr 9, 2008
  6. Junio C HamanoApr 9, 2008
  7. Miklos VajnaApr 9, 2008

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.