<commit_before>Gerrit Code Review - Searching Changes
======================================

Default Searches 
----------------

Most basic searches can be viewed by clicking on a link along the top
menu bar.  The link will prefill the search box with a common search
query, execute it, and present the results.  If exactly one change
matches the search, the change will be presented instead of a list.


[grid="all"]
`---------------------------`------------------------------
Description                 Default Query
-----------------------------------------------------------
All > Open                  status:open '(or is:open)'
All > Merged                status:merged
All > Abandoned             status:abandoned
My > Dafts                  has:draft
My > Watched Changes        status:open is:watched
My > Starred Changes        is:starred
Open changes in Foo         status:open project:Foo
-----------------------------------------------------------

Basic Change Search
-------------------

Similar to many popular search engines on the web, just enter some
text and let Gerrit figure out the meaning:

[grid="all"]
`---------------------------------`------------------------------
Description                       Examples
-----------------------------------------------------------------
Legacy numerical id               15183
Full or abbreviated Change-Id     Ic0ff33
Full or abbreviated commit SHA-1  d81b32ef
Email address                     <EMAIL>
Approval requirement              CodeReview>=+2, Verified=1
-----------------------------------------------------------------


Search Operators
----------------

Operators act as restrictions on the search.  As more operators
are added to the same query string, they further restrict the
returned results.

[[age]]
age:'AGE'::
+
Amount of time that has expired since the change was last updated
with a review comment or new patch set.  The age must be specified
to include a unit suffix, for example `age:2d`:
+
* s, sec, second, seconds
* m, min, minute, minutes
* h, hr, hour, hours
* d, day, days
* w, week, weeks (`1 week` is treated as `7 days`)
* mon, month, months (`1 month` is treated as `30 days`)
* y, year, years (`1 year` is treated as `365 days`)

[[change]]
change:'ID'::
+
Either a legacy numerical 'ID' such as 15183, or a newer style
Change-Id that was scraped out of the commit message.

[[owner]]
owner:'USER'::
+
Changes originally submitted by 'USER'.

[[reviewer]]
reviewer:'USER'::
+
Changes that have been, or need to be, reviewed by 'USER'.

[[commit]]
commit:'SHA1'::
+
Changes where 'SHA1' is one of the patch sets of the change.

[[project]]
project:'PROJECT'::
+
Changes occuring in 'PROJECT'.  If 'PROJECT' starts with `^` it
matches project names by regular expression.

[[branch]]
branch:'BRANCH'::
+
Changes for 'BRANCH'.  The branch name is the short name shown
in the web interface, without the traditional 'refs/heads/'
prefix.  This operator is a shorthand for 'refs:'.  Searching for
'branch:master' really means 'ref:refs/heads/master', and searching
for 'branch:refs/heads/master' is the same as searching for
'ref:refs/heads/refs/heads/master'.
+
If 'BRANCH' starts with `^` it matches branch names by regular
expression patterns.

[[topic]]
topic:'TOPIC'::
+
Changes whose designated topic at upload was 'TOPIC'.  This is
often combined with 'branch:' and 'project:' operators to select
all related changes in a series.
+
If 'TOPIC' starts with `^` it matches topic names by regular
expression patterns.

[[ref]]
ref:'REF'::
+
Changes where the destination branch is exactly the given 'REF'
name.  Since 'REF' is absolute from the top of the repository it
must start with 'refs/'.
+
If 'REF' starts with `^` it matches reference names by regular
expression patterns.

[[tr]][[bug]]
tr:'ID', bug:'ID'::
+
Search for changes whose commit message contains 'ID' and matched
one or more of the
link:config-gerrit.html#trackingid[trackingid sections]
in the server's configuration file.  This is typically used to
search for changes that fix a bug or defect by the issue tracking
system's issue identifier.

[[label]]
label:'VALUE'::
+
Matches changes where the approval score 'VALUE' has been set during
a review.  See <<labels,labels>> below for more detail on the format
of the argument.

[[file]]
file:\^'REGEX'::
+
Matches any change where REGEX matches a file that was affected
by the change.  The regular expression pattern must start with
'\^'.  For example, to match all XML files use `file:^.*\.xml$`.
Currently this operator is only available on a watched project
and may not be used in the search bar.

[[has]]
has:draft::
+
True if there is a draft comment saved by the current user.

has:star::
+
Same as 'is:starred', true if the change has been starred by the
current user.

[[is]]
is:starred::
+
Same as 'has:star', true if the change has been starred by the
current user.

is:watched::
+
True if this change matches one of the current user's watch filters,
and thus is likely to notify the user when it updates.

is:reviewed::
+
True if there is at least one non-zero score on the change, in any
approval category, by any user.

is:open::
+<commit_msg>File search operator documentation improvement<commit_after>Gerrit Code Review - Searching Changes
======================================

Default Searches 
----------------

Most basic searches can be viewed by clicking on a link along the top
menu bar.  The link will prefill the search box with a common search
query, execute it, and present the results.  If exactly one change
matches the search, the change will be presented instead of a list.


[grid="all"]
`---------------------------`------------------------------
Description                 Default Query
-----------------------------------------------------------
All > Open                  status:open '(or is:open)'
All > Merged                status:merged
All > Abandoned             status:abandoned
My > Dafts                  has:draft
My > Watched Changes        status:open is:watched
My > Starred Changes        is:starred
Open changes in Foo         status:open project:Foo
-----------------------------------------------------------

Basic Change Search
-------------------

Similar to many popular search engines on the web, just enter some
text and let Gerrit figure out the meaning:

[grid="all"]
`---------------------------------`------------------------------
Description                       Examples
-----------------------------------------------------------------
Legacy numerical id               15183
Full or abbreviated Change-Id     Ic0ff33
Full or abbreviated commit SHA-1  d81b32ef
Email address                     <EMAIL>
Approval requirement              CodeReview>=+2, Verified=1
-----------------------------------------------------------------


Search Operators
----------------

Operators act as restrictions on the search.  As more operators
are added to the same query string, they further restrict the
returned results.

[[age]]
age:'AGE'::
+
Amount of time that has expired since the change was last updated
with a review comment or new patch set.  The age must be specified
to include a unit suffix, for example `age:2d`:
+
* s, sec, second, seconds
* m, min, minute, minutes
* h, hr, hour, hours
* d, day, days
* w, week, weeks (`1 week` is treated as `7 days`)
* mon, month, months (`1 month` is treated as `30 days`)
* y, year, years (`1 year` is treated as `365 days`)

[[change]]
change:'ID'::
+
Either a legacy numerical 'ID' such as 15183, or a newer style
Change-Id that was scraped out of the commit message.

[[owner]]
owner:'USER'::
+
Changes originally submitted by 'USER'.

[[reviewer]]
reviewer:'USER'::
+
Changes that have been, or need to be, reviewed by 'USER'.

[[commit]]
commit:'SHA1'::
+
Changes where 'SHA1' is one of the patch sets of the change.

[[project]]
project:'PROJECT'::
+
Changes occuring in 'PROJECT'.  If 'PROJECT' starts with `^` it
matches project names by regular expression.

[[branch]]
branch:'BRANCH'::
+
Changes for 'BRANCH'.  The branch name is the short name shown
in the web interface, without the traditional 'refs/heads/'
prefix.  This operator is a shorthand for 'refs:'.  Searching for
'branch:master' really means 'ref:refs/heads/master', and searching
for 'branch:refs/heads/master' is the same as searching for
'ref:refs/heads/refs/heads/master'.
+
If 'BRANCH' starts with `^` it matches branch names by regular
expression patterns.

[[topic]]
topic:'TOPIC'::
+
Changes whose designated topic at upload was 'TOPIC'.  This is
often combined with 'branch:' and 'project:' operators to select
all related changes in a series.
+
If 'TOPIC' starts with `^` it matches topic names by regular
expression patterns.

[[ref]]
ref:'REF'::
+
Changes where the destination branch is exactly the given 'REF'
name.  Since 'REF' is absolute from the top of the repository it
must start with 'refs/'.
+
If 'REF' starts with `^` it matches reference names by regular
expression patterns.

[[tr]][[bug]]
tr:'ID', bug:'ID'::
+
Search for changes whose commit message contains 'ID' and matched
one or more of the
link:config-gerrit.html#trackingid[trackingid sections]
in the server's configuration file.  This is typically used to
search for changes that fix a bug or defect by the issue tracking
system's issue identifier.

[[label]]
label:'VALUE'::
+
Matches changes where the approval score 'VALUE' has been set during
a review.  See <<labels,labels>> below for more detail on the format
of the argument.

[[file]]
file:\^'REGEX'::
+
Matches any change where REGEX matches a file that was affected
by the change.  The regular expression pattern must start with
`\^`.  For example, to match all XML files use `file:^.*\.xml$`.
+
The `\^` required at the beginning of the regular expression not only
denotes a regular expression, but it also has the usual meaning of
anchoring the match to the start of the string.  To match all Java
files, use `file:^.*\.java`.
+
The entire regular expression pattern, including the `\^` character,
should be double quoted when using more complex construction (like
ones using a bracket expression). For example, to match all XML
files named like 'name1.xml', 'name2.xml', and 'name3.xml' use
`\file:"\^name[1-3].xml"`.
+
Currently this operator is only available on a watched project
and may not be used in the search bar.

[[has]]
has:draft::
+
True if there is a draft comment saved by the current user.

has:star::
+
Same as 'is:starred', true if the change has been starred by the
current user.

[[is]]
is:starred::
+
Same as 'has:star', true if the change has been starred by the
current user.

is:watched::
+
True if this change matches one of the current user's watch filters,
and thus is likely to notify the user when it updates.

is:reviewed::
+
True if there is at least one non-zero score on the change, in any
approval category, by any user.

is:open::
+
{'fraction_non_alphanumeric': 0.1665140974002197, 'fraction_numerical': 0.006316367630904431, 'mean_word_length': 2.7312158469945356, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4599172', 'n_tokens_mistral': 2979, 'n_tokens_neox': 2848, 'n_words': 1417}