threads / discuss / 13695

git log --grep missing entries?

Subject: git log --grep missing entries?

## tl;dr

4 messages between May 27, 2008 and May 27, 2008.

replies: 3people: 3as markdown or json

Chris Frey· May 27, 2008, 20:28 UTC · lore
Hi,

I ran into this the other day when I was looking at jgit's log history. I retested today with the latest master branch, and it does the same thing.

So... what am I doing wrong?
	git clone git://repo.or.cz/egit/spearce.git bsd
	git log |grep "^Author:" | sort | uniq
	# note the user: Thad Hughes <thadh@thad.corp.google.com>
	# nothing appears for these commands
	git log --grep="thadh@thad.corp.google.com"
	git log --grep="google.com"
	git log --grep="thadh"
	# this works
	git log --author="thadh@thad.corp.google.com"
	# this works
	git log | grep thadh@thad.corp.google.com
- Chris
Lea Wiemann· May 27, 2008, 20:36 UTC · re: Chris Frey · lore

Re: git log --grep missing entries?

Chris Frey wrote:
> 	# nothing appears for these commands
> 	git log --grep="thadh@thad.corp.google.com"
> 	# this works
> 	git log --author="thadh@thad.corp.google.com"

According to the man page of git-log, --grep only greps the log message, not the author. Does that help?

-- Lea
Chris Frey· May 27, 2008, 20:48 UTC · re: Lea Wiemann · lore

Re: git log --grep missing entries?

On Tue, May 27, 2008 at 10:36:51PM +0200, Lea Wiemann wrote:
> According to the man page of git-log, --grep only greps the log message, 
> not the author.  Does that help?
Doh.  That would certainly explain it.  Thanks!
- Chris
Björn Steinbrink· May 27, 2008, 20:40 UTC · re: Chris Frey · lore

Re: git log --grep missing entries?

On 2008.05.27 16:28:42 -0400, Chris Frey wrote:
Show 22 quoted lines
> Hi,
> 
> I ran into this the other day when I was looking at jgit's log history.
> I retested today with the latest master branch, and it does the same thing.
> 
> So... what am I doing wrong?
> 
> 	git clone git://repo.or.cz/egit/spearce.git bsd
> 	git log |grep "^Author:" | sort | uniq
> 
> 	# note the user: Thad Hughes <thadh@thad.corp.google.com>
> 
> 	# nothing appears for these commands
> 	git log --grep="thadh@thad.corp.google.com"
> 	git log --grep="google.com"
> 	git log --grep="thadh"
> 
> 	# this works
> 	git log --author="thadh@thad.corp.google.com"
> 
> 	# this works
> 	git log | grep thadh@thad.corp.google.com

--grep only works on the log message, not on the author or committer fields. As Thad's commit does not have a SoB line, --grep won't find it.

Björn

← back to recent threads