How to set use-content-merge in all projects

121 views
Skip to first unread message

chang seungcheol

unread,
Apr 10, 2012, 9:21:27 AM4/10/12
to Repo and Gerrit Discussion
hi

after upgrading gerrit version, there is no projects table in gerrit
DB,
so I can't control style of content-merge in all projects
if there is a projects table in DB, I can set use-content-merge to Y
from N
Isn't there a better way to do this? without projects table in DB

Magnus Bäck

unread,
Apr 10, 2012, 10:51:31 AM4/10/12
to Repo and Gerrit Discussion
On Tuesday, April 10, 2012 at 09:21 EDT,
chang seungcheol <seungche...@gmail.com> wrote:

Assuming you want to do this programatically rather than via the web UI,
you can update the submit.mergeContent key in project.config in
All-Projects.git (or whatever project you want to apply the setting in).

git clone <url of All-Projects.git>
cd All-Projects
git config --file project.config submit.contentMerge true
git commit -a -m 'Enabled content merges'
git push origin HEAD:refs/meta/config

For projects that aren't permission-only you probably don't want
to clone the git itself, because even if you do you won't get the
refs/meta/config ref. Then it would go something like this:

cd `mktemp -dt`
git init
git fetch <url of All-Projects.git> refs/meta/config
git checkout FETCH_HEAD
git config --file project.config submit.contentMerge true
git commit -a -m 'Enabled content merges'
git push origin HEAD:refs/meta/config

It struck me that the project.config file format is undocumented. Has
anyone started any work on this?

--
Magnus Bäck
ba...@google.com

Luthander, Fredrik

unread,
Apr 10, 2012, 11:00:57 AM4/10/12
to Magnus Bäck, Repo and Gerrit Discussion

> -----Original Message-----
> From: repo-d...@googlegroups.com [mailto:repo-
> dis...@googlegroups.com] On Behalf Of Magnus Bäck
> Sent: tisdag den 10 april 2012 16:52
> To: Repo and Gerrit Discussion
> Subject: Re: How to set use-content-merge in all projects
>
<snip>


>
> It struck me that the project.config file format is undocumented. Has
> anyone started any work on this?
>

Hi Magnus. :)

I have begun work on this. However, the work is so far not uploaded for public review, as I'm playing around with the structure of it, and haven't made that much progress on actual content either. (I was on to a good start there for a while, but accidentally wasted about two hours of work by a tiny misspelled command.. and I'm the one teaching others not to waste their work by using git! The irony stares me in the face..)

Anyway, please expect a new manual page covering the files of refs/meta/config and their format and possible parameters in the near future (the coming weeks?).

--
Best regards,
    Fredrik Luthander
Sony Mobile Communications AB

Magnus Bäck

unread,
Apr 10, 2012, 11:22:42 AM4/10/12
to Repo and Gerrit Discussion
On Tuesday, April 10, 2012 at 11:00 EDT,
"Luthander, Fredrik" <Fredrik....@sonymobile.com> wrote:

[...]

> Anyway, please expect a new manual page covering the files of
> refs/meta/config and their format and possible parameters in
> the near future (the coming weeks?).

Great! Please add me as a reviewer when you've uploaded it.

While it might not end up in the same document, there's both
a need of a reference section and a couple of recipes of how
to actually modify the files therein. As evidenced by my previous
message there are a few snags that people should get help avoiding,
and I didn't even go into how groups need to be added to the
the group file to be eligible to addition in project.config.
Also, right now you can't obtain the group's UUID except via
the web UI (but I'm working on changing that).

--
Magnus Bäck
ba...@google.com

Shawn Pearce

unread,
Apr 10, 2012, 1:26:56 PM4/10/12
to Repo and Gerrit Discussion
On Tue, Apr 10, 2012 at 07:51, Magnus Bäck <ba...@google.com> wrote:
> On Tuesday, April 10, 2012 at 09:21 EDT,
>     chang seungcheol <seungche...@gmail.com> wrote:
>
>> after upgrading gerrit version, there is no projects table in gerrit
>> DB,
>> so I can't control style of content-merge in all projects
>> if there is a projects table in DB, I can set use-content-merge to Y
>> from N
>> Isn't there a better way to do this? without projects table in DB
>
> Assuming you want to do this programatically rather than via the web UI,
> you can update the submit.mergeContent key in project.config in
> All-Projects.git (or whatever project you want to apply the setting in).

This setting isn't inherited, so you need to set it in every repository.

Magnus Bäck

unread,
Apr 10, 2012, 1:54:17 PM4/10/12
to Repo and Gerrit Discussion
On Tuesday, April 10, 2012 at 10:51 EDT,
Magnus Bäck <ba...@google.com> wrote:

[...]

> cd `mktemp -dt`
> git init
> git fetch <url of All-Projects.git> refs/meta/config
> git checkout FETCH_HEAD
> git config --file project.config submit.contentMerge true
> git commit -a -m 'Enabled content merges'
> git push origin HEAD:refs/meta/config

Git won't set up an origin remote in this case, so you either need to
run "git remote add" or you need to specify the full push URL in the
final command.

[...]

--
Magnus Bäck
ba...@google.com

Anthony Wong

unread,
Jul 31, 2012, 9:48:24 AM7/31/12
to repo-d...@googlegroups.com
Hi--
 
Should the project.config variable be mergeContent (not contentMerge)?
 
--Anthony

Magnus Bäck

unread,
Jul 31, 2012, 9:53:09 AM7/31/12
to repo-d...@googlegroups.com
On Tuesday, July 31, 2012 at 09:48 EDT,
Anthony Wong <won...@gmail.com> wrote:

> On Tuesday, April 10, 2012 10:54:17 AM UTC-7, Magnus Bäck wrote:
>
> > > cd `mktemp -dt`
> > > git init
> > > git fetch <url of All-Projects.git> refs/meta/config
> > > git checkout FETCH_HEAD
> > > git config --file project.config submit.contentMerge true
> > > git commit -a -m 'Enabled content merges'
> > > git push origin HEAD:refs/meta/config
> >
> > Git won't set up an origin remote in this case, so you either need
> > to run "git remote add" or you need to specify the full push URL in
> > the final command.
>
> Should the project.config variable be mergeContent (not contentMerge)?

Yes, you're right. Sorry about that.

--
Magnus Bäck
ba...@google.com

Edwin Kempin

unread,
Jul 31, 2012, 9:55:10 AM7/31/12
to Anthony Wong, repo-d...@googlegroups.com


2012/7/31 Anthony Wong <won...@gmail.com>

Hi--
 
Should the project.config variable be mergeContent (not contentMerge)?
It is 'mergeContent'.
 

Reply all
Reply to author
Forward
0 new messages