16

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.

Jed Anderson
  • 901
  • 1
  • 8
  • 23

2 Answers2

27

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).

palacsint
  • 28,416
  • 10
  • 82
  • 109
Jed Anderson
  • 901
  • 1
  • 8
  • 23
  • The necessity to add `status:merged` (and limitation that you cannot search both merged and open) exists in Gerrit 2.7 too. Hopefully it is removed in some future versions. I think i saw this working *correctly* though I don't know which version fixes this. – Piotr Findeisen Apr 09 '15 at 08:13
7

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.

David Pursehouse
  • 933
  • 6
  • 14