How to search changes using regular expression on Gerrit

435 views
Skip to first unread message

程洋

unread,
Oct 11, 2022, 11:41:55 AM10/11/22
to Repo and Gerrit Discussion
I noticed that Gerrit use  dk.brics.automaton to compute regular expression.
It's a little bit tricky for me. Is it possibel to search branch starts with "master-t" or "release-t"?

branch:^master-t.* OR branch:^release-t.* does the trick.
But is it possibel to combine them into one regular expression
branch:^(master-t.*|release-t.*) doesn't work

程洋

unread,
Oct 11, 2022, 11:44:40 AM10/11/22
to Repo and Gerrit Discussion
To be honest. what i really want to do, is to enable code owner plugin only on branch starts with "master-t" or "release-t"
But disabledBranch = ^refs/(?!heads/(master-t|release-t)$).* doesn't work

syntonyze

unread,
Oct 11, 2022, 12:23:50 PM10/11/22
to 程洋, Repo and Gerrit Discussion
On Tue, 11 Oct 2022 at 16:44, 程洋 <d171...@gmail.com> wrote:
To be honest. what i really want to do, is to enable code owner plugin only on branch starts with "master-t" or "release-t"
But disabledBranch = ^refs/(?!heads/(master-t|release-t)$).* doesn't work

On Tuesday, October 11, 2022 at 11:41:55 PM UTC+8 程洋 wrote:
I noticed that Gerrit use  dk.brics.automaton to compute regular expression.
It's a little bit tricky for me. Is it possibel to search branch starts with "master-t" or "release-t"?

I think your regex breaks because you're not escaping your forward slashes ('/' should be escaped '\/')
Have you tried to see if your regexp works outside Gerrit at all?

You can use any online tool, for example, this [1]

 

branch:^master-t.* OR branch:^release-t.* does the trick.
But is it possibel to combine them into one regular expression
branch:^(master-t.*|release-t.*) doesn't work

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/a536536a-833b-4308-a917-cd2a500e5d1bn%40googlegroups.com.

程洋

unread,
Oct 12, 2022, 7:36:52 AM10/12/22
to Repo and Gerrit Discussion
Yes, i've already tried my regular expression and it seems OK.
But i find another way of regualr expression to solve this. Thanks for your help
Reply all
Reply to author
Forward
0 new messages