Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Searching Gerrit by Commit Message

Tags:

gerrit

Our team uses a standard of prefixing all commit messages with "bz12345:" (where 12345 is replaced by the bug you're working on) and I'd like to be able to search for all commits that have that bug number.

I've read http://gerrit.googlecode.com/svn/documentation/2.1.6/user-search.html over and over and haven't figured out a way to search for commit message titles. Does anybody have a trick for searching the first line of a commit message for arbitrary text? None of message:, tr:, and bug: work.

like image 338
Jed Anderson Avatar asked Jan 18 '13 23:01

Jed Anderson


People also ask

How do I get commit from Gerrit?

If needed this commit can be fetched from Gerrit by using the fetch command from the download commands in the change screen. It is important that the commit message contains the Change-Id of the change that should be updated as a footer (last paragraph).

How do I find my change-ID on Gerrit?

The trick is search by "message:" instead of "change:". Change-Id is part of the commit message and searchable. "change:" must refer to some other field. Save this answer.

How do I find my Gerrit branches?

Visit Gerrit then select Projects --> List --> SELECT-PROJECT --> Branches .

How do I see my review comments on Gerrit?

Show activity on this post. Where <changeid> is the Gerrit change-id or change number. This will show you all the comments, including inline comments from files, associated with the current patch set. You can replace --current-patch-set with --patch-sets to see this for all patch sets.


2 Answers

Ah, I figured it out. You MUST have a status: query too. For example, this works:

status:merged message:bz12345

This does not:

message:bz12345

This could be because we're on an older version of Gerrit (2.2.1 I think).

like image 170
Jed Anderson Avatar answered Oct 15 '22 13:10

Jed Anderson


message:bz12345 should work.

See the latest documentation

Note that it searches the whole message body though, not just the subject.

message:'MESSAGE'

Changes that match MESSAGE arbitrary string in the commit message body.

like image 40
David Pursehouse Avatar answered Oct 15 '22 11:10

David Pursehouse