Can we set Projects Options CLI?

44 views
Skip to first unread message

seonguk.baek

unread,
Apr 4, 2012, 10:36:40 PM4/4/12
to Repo and Gerrit Discussion
Hello All :-)

Can I set Projects Options about Automatically resolve conflicts?
I want to avoid path conflict, so I set "Automatically resolve
conflicts" checkbox.
But we have lots of repositories.

How can I set this option all of repositories at once?

Thanks.

Peter Niederlag

unread,
Apr 5, 2012, 2:40:37 AM4/5/12
to seonguk.baek, Repo and Gerrit Discussion
Hi,

if you are on >2.2.x you could script some git commands around:
* checkout refs/meta/config
* hack groups and project.config {ssh gerrit gsql helps to get required
groups info)
* commit

Did anybody already put this into a common script (could safe me some
more work)?

AFAIK there is no easier way.

Greets,
Peter

Matthias Sohn

unread,
Apr 5, 2012, 3:09:15 AM4/5/12
to seonguk.baek, Repo and Gerrit Discussion
2012/4/5 seonguk.baek <baeks...@gmail.com>
AFAIK you can use a permissions-only project to achieve that:
- create a permissions-only project [1] named e.g. "Default Settings" 
  using "gerrit create-project --permissions-only"
- set default settings in this permissions-only project including the merge strategy options 
- change parent of all projects which should inherit these settings [2] using
  "gerrit set-project-parent --parent <name of the default settings project> <name of the project to reparent>"
- individual projects can still override the settings inherited from their respective parent project
- use "gerrit ls-projects" [3] to create a script doing this for all projects you want to change
  the settings for. Alternatively, if you are using Gerrit 2.3, you can use "gerrit set-project-parent"'s
  options "--children"-of and "--exclude" to re-parent the projects which should inherit
  these default settings
- if you need different types of default settings you may consider to create 
  different permissions-only projects which may also form an inheritance hierarchy

I think this approach would deserve a new section in the gerrit documentation.


--
Matthias

Edwin Kempin

unread,
Apr 5, 2012, 4:19:11 AM4/5/12
to Matthias Sohn, seonguk.baek, Repo and Gerrit Discussion
Hi,

at the moment permissions-only projects can only be used for defining access rights.
Setting a merge strategy and the Automatically Resolve Conflicts option on a permissions-only project has no effect and is not inherited by the child projects.
However there is a change in review that supports submit types per refspec [1] and I think this change also introduces inheritance for the submit types.

Best regards,
Edwin

[1] https://gerrit-review.googlesource.com/16562

2012/4/5 Matthias Sohn <matthi...@googlemail.com>

Reply all
Reply to author
Forward
0 new messages