How do you enable/use refs/meta/config?

3,818 views
Skip to first unread message

Joshua J. Kugler

unread,
Apr 11, 2014, 7:05:23 PM4/11/14
to repo-discuss
I'm reading over this:

https://gerrit-documentation.storage.googleapis.com/Documentation/2.8.4/config-project-config.html

(mind the wrap)

It says I should be able to find project.config (among others) in
refs/meta/config when I check out a project (I am an admin, so have read on
all areas of the project).

However, when I clone a project, I do not even have a .git/refs/meta
directory. What do I have to do to enable this namespace? I'd very much like
to programtically edit permissions, the instructions on the above web page are
lacking when it comes to how to actually extract that information.

Thanks!

j

--
Joshua J. Kugler - Fairbanks, Alaska
Azariah Enterprises - Programming and Website Design
jos...@azariah.com - Jabber: peda...@gmail.com
PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A

Matthias Sohn

unread,
Apr 11, 2014, 7:19:44 PM4/11/14
to Joshua J. Kugler, repo-discuss
On Sat, Apr 12, 2014 at 1:05 AM, Joshua J. Kugler <jos...@azariah.com> wrote:
I'm reading over this:

https://gerrit-documentation.storage.googleapis.com/Documentation/2.8.4/config-project-config.html

(mind the wrap)

It says I should be able to find project.config (among others) in
refs/meta/config when I check out a project (I am an admin, so have read on
all areas of the project).

However, when I clone a project, I do not even have a .git/refs/meta
directory.  What do I have to do to enable this namespace? I'd very much like
to programtically edit permissions, the instructions on the above web page are
lacking when it comes to how to actually extract that information.

refs/meta/config is a branch which isn't under refs/heads hence git doesn't fetch
it by default. Do something like

$ git init cfg ; cd cfg
$ git remote add origin ssh://developer@localhost:29418/All-Projects
$ git pull origin refs/meta/config
$ vi project.config
$ git commit -a -m 'Updated permissions'
$ git push origin HEAD:refs/meta/config

see slide 51 in [1].


--
Matthias 

Alex Blewitt

unread,
Apr 11, 2014, 7:20:34 PM4/11/14
to Joshua J. Kugler, repo-discuss
On 12 Apr 2014, at 00:05, Joshua J. Kugler <jos...@azariah.com> wrote:

> I'm reading over this:
>
> https://gerrit-documentation.storage.googleapis.com/Documentation/2.8.4/config-project-config.html
>
> (mind the wrap)
>
> It says I should be able to find project.config (among others) in
> refs/meta/config when I check out a project (I am an admin, so have read on
> all areas of the project).
>
> However, when I clone a project, I do not even have a .git/refs/meta
> directory. What do I have to do to enable this namespace? I'd very much like
> to programtically edit permissions, the instructions on the above web page are
> lacking when it comes to how to actually extract that information.

When you clone a repository, by default it only gets the branches and tags, not necessarily every reference. So you’ll need to fetch these additional refs from the repository.

To do this in your case, you can do git fetch orgin +refs/meta/config:refs/meta/config, from which you can check it out.

Alex

Joshua J. Kugler

unread,
Apr 11, 2014, 9:10:00 PM4/11/14
to repo-d...@googlegroups.com, Matthias Sohn, Alex Blewitt
Thank you to Matthais and Alex (and jrnieder on #gerrit) I got it figured out
and working.

Thank you very much!

j

Welch, Ronald P (US SSA)

unread,
Sep 26, 2014, 1:08:38 PM9/26/14
to repo-discuss
Is there a (reasonably easy) way to change the entries in the
download menu on the change screen?

For example, I would like to add a couple switches to the end
cherry-pick command.

A plugin perhaps?

----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com Phone:(607)206-8718
BAE SYSTEMS 1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

Jan Kundrát

unread,
Sep 29, 2014, 1:52:27 PM9/29/14
to repo-d...@googlegroups.com
On Friday, 26 September 2014 19:08:30 CEST, Welch, Ronald P (US SSA) wrote:
> Is there a (reasonably easy) way to change the entries in the
> download menu on the change screen?
>
> For example, I would like to add a couple switches to the end
> cherry-pick command.
>
> A plugin perhaps?

If you're OK with writing Java, you can either patch [1] locally, or create
your own plugin based on that.

Cheers,
Jan

[1]
gerrit-gwtui/src/main/java/com/google/gerrit/client/download/DownloadCommandLink.java



--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/

Dave Borowitz

unread,
Sep 29, 2014, 1:56:50 PM9/29/14
to Jan Kundrát, repo-discuss
Unfortunately you can't modify existing download commands, you would have to disable the built-in version of cherry-pick and replace it with your own.

What flags are you considering adding? It might be worth changing the upstream command if they're of enough general interest. For example someone requested recently to add --ff, which I think would be a reasonable default.



--
--
To unsubscribe, email repo-discuss+unsubscribe@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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edwin Kempin

unread,
Sep 29, 2014, 2:03:44 PM9/29/14
to Dave Borowitz, Jan Kundrát, repo-discuss
The project-download-commands plugin [1] allows you to freely define download commands on project level.
It also supports inheritance, so you can define your download command in the All-Projects project to make
it available for all projects. For details check the plugin documentation [2,3].

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.

Welch, Ronald P (US SSA)

unread,
Sep 29, 2014, 4:25:02 PM9/29/14
to Dave Borowitz, Jan Kundrát, repo-discuss
Hi Dave,

I am thinking of adding -Xtheirs -Xpatience --strategy-option=recursive

to the cherry-pick command. Long story short, it is one potential 
way of avoiding merge conflicts in our (rather convoluted) change
management process. 

I am not sure it would be a recommended best practice for most 
people and therefore probably not a good candidate for become 
the default :)

Thanks,
Ron
----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

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.

Dave Borowitz

unread,
Sep 29, 2014, 4:30:24 PM9/29/14
to Ronald P Welch (US SSA), repo-discuss, Jan Kundrát

Thanks for the explanation, yeah, that sounds pretty specific to your workflow.

Welch, Ronald P (US SSA)

unread,
Sep 30, 2014, 6:10:37 AM9/30/14
to Edwin Kempin, Dave Borowitz, Jan Kundrát, repo-discuss
Hi Edwin,

The project-download-commands plugin sounds like it might be 
exactly what I am looking for. I will check it out (no pun
intended :)

Thanks,
Ron
----------=-=-=-=-=-=-=-=-========oOo========-=-=-=-=-=-=-=-=----------
mailto:Ronald....@baesystems.com                Phone:(607)206-8718
BAE SYSTEMS                       1701 North Street, Endicott, NY 13760
----------=-=-=-=-=-=-=-=-===================-=-=-=-=-=-=-=-=----------

Reply all
Reply to author
Forward
0 new messages