# git log and --first-parent

2 messages from 2007-07-23 to 2007-07-26. Participants: Robin Rosenberg.
Thread: https://gitlist.dev/t/9187

## Robin Rosenberg, 2007-07-23 23:05

Subject: git log and --first-parent
Message-ID: <200707240105.33729.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200707240105.33729.robin.rosenberg.lists%40dewire.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

```

## Robin Rosenberg, 2007-07-26 20:30

Subject: Re: git log and --first-parent
Message-ID: <200707262230.10701.robin.rosenberg.lists@dewire.com>
URL: https://gitlist.dev/e/200707262230.10701.robin.rosenberg.lists%40dewire.com
In-Reply-To: <200707240105.33729.robin.rosenberg.lists@dewire.com>

```
tisdag 24 juli 2007 skrev Robin Rosenberg:
> 
> 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

Now, I also realize fast-forwards means --first-parent may not be as useful as I first
hoped.

-- robin

```
