For example there are words like appletree and applepie in commit message,
how can I do something like
message:apple*
to find the commit that contains appletree and applepie ?
Try new RegExp("apple#"). It will match all strings that start with "apple". # means the same as .*.
or
Quoting is accepted as either double quotes (e.g. message:"the value") or as matched curly braces (e.g. message:{the value}).
You can use regular expressions in Gerrit search adding a "^" at the beginning of the expression like in the following example:
path:"^report-.*[13].sh"
But unfortunately you only can do this with the following search operators:
project
repository
branch
intopic
ref
path
file
directory
See more info in Gerrit documentation here
Gerrit is upgraded to version 3.6 or later to support regular expression on the commit message as a condition.
e.g. message:^.*apple.*
See more info in Gerrit documentation Release-note user-search
Related
The Jenkins email-ext plugin supports a ${LOG_REGEX} 'token'. It's documented like this:
${LOG_REGEX}
Uses a regular expression to find a single log entry and generates a new output using the capture groups from it. This is partially based on the description-setter plugin (https://github.com/jenkinsci/description-setter-plugin).
(That's part of the documentation that's shown when I click on the "?" (question mark) associated with the Content Token Reference in the Editable Email Notification section of the Jenkins project configuration page.)
When I use this token, how do I specify the regular expression and the output? I guess it probably takes a pair of parameters, but, if so, what are their names?
I determined through trial and error that the parameter names are regex and replacement.
For example, if your job console contains
Started by upstream project "my-project" build number 12345
then the token
${LOG_REGEX, regex="^Started by upstream project \"(.+)\" build number ([0-9]+)", replacement="\\1 #\\2"}
will be replaced by
my-project #12345
Keep in mind that, in parameter values, \ and " must be escaped with a \.
In the Branches to build field in Jenkins I would like it to use a branch name with the prefix:
Production-release-
A number would follow the second dash as supplied by our groovy script.
What is the proper syntax to show a wildcard at the end of this prefix?
Assuming you want to use it in a branch statement in declarative syntax, you can use an asterisk (*). Production-release-* should do the job.
Fuchsia > Guides > Contribute changes > Add commit message tags states:
[]
(1)How does one determine what tags to use? (2)Is there an algorithm calculating the two strings such as simply using the directory name and ..? If this were the case, the file path already has that info.
(3)Apparently [docs] is in addition to [parent] [component]. Are their other additional tags?
(4)For example, if changing the file fuchsia/src/lib/fxl/README.md what tags should be used?
I found no info in Gerrit Code Review for Git about [tags]. So, it seems to imply that this is a Fuchsia OS convention or info within a commit message.
Fuchsia > Gerrit > Repositories > fuchsia > tags has an empty list.
I think you confuse the git tags with the tags mentioned in the Fuchsia documentation.
You are required to add [parent][component], what they call tags, to your commit messages.
My guess that your commit message would look something like:
[lib][fxl] Updating README.md
You can look at the history of your component for inspiration: https://fuchsia.googlesource.com/fuchsia/+log/refs/heads/master/src/lib/fxl
1.How to replace back slash with forward slash in Jenkins on UI :- SVN_EAR_PATH (String parameter)
You cannot change a parameter's value in a freestyle job. When you use git you can use the Git parameter plugin to present the user with all the available tags, but I'm not aware of any Subversion alternative unfortunately.
I think your best effort in this case would be to write a pipeline job and then you will have control over the parameter's value (you could write SVN_EAR_PATH.replace('\\', '/'))
I'm not sure what I am missing but I can't either Filter by name (with regular expression) or Filter by name (with wildcards) to match any branches. Even with the default .* Discover branches works fine. Am I missing something obvious?
I just figured out what I was missing. You have to have both Discover and filter for it to work. Sigh...
You have to choose both of these options, for example: