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

git log and --first-parent

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Jul 23, 2007, 23:05 UTC
Message-ID
<200707240105.33729.robin.rosenberg.lists@dewire.com>

I'm puzzled over the behavior of --first-parent. The documentations seems to imply that only the first parent is followed, but when a filter is applied it seems (just guessing) that the "first" parent is selected *after* filtering, a behaviour that I feel does not match the documentation.

Should the first-parent filter be applied first.
Example:
	git log --first-parent --pretty=format: --name-only v1.5.2|grep ^var.c|wc -l
counts four commits where var.c was changed, while
	git log --first-parent --pretty=format: --name-only v1.5.2 -- var.c |wc -l
gives me 23. 
-- robin
Next: Robin Rosenberg
Message 1 of 2 in “git log and --first-parent”
  1. Robin RosenbergJul 23, 2007
  2. Robin RosenbergJul 26, 2007

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.