Please help... how do I add the Label:Verified to All-Projects?

2,368 views
Skip to first unread message

Jay Pipes

unread,
Jun 6, 2013, 12:14:50 PM6/6/13
to repo-d...@googlegroups.com
I am confused, please help. I'm trying to add a Verified label that will
be used only by our CI tools.

As far as I can tell from the documentation, in order to do this, one
needs to edit the project.config file for the All-Projects.git
repository that Gerrit controls.

I am looking for help on the git commands I need to do to get the change
properly submitted into Gerrit and have it recognize the changes.

So far, I've done:

git clone $host:All-Project.git

This checks out the repo, but in a detached head state, something I
don't really understand why is happening -- doesn't the repo have a
default branch?

Anyway, I then do:

cd All-Projects.git
vi project.config
git commit -a -m "Add verified label"
git push origin HEAD:refs/meta/config

and things seem to work.

But then, if I want to make changes later, if I git pull origin
HEAD:refs/meta/config, I get merge conflicts...

I'm stumped as to how to work with this magic meta/config repository
thing and would sure appreciated some help.

BTW, is it intentional that one can add am existing label permission to
an existing group in the web UI to All-Projects, but one cannot add a
label in the same edit area?

Thanks very much in advance,
-jay

Alex Blewitt

unread,
Jun 6, 2013, 5:12:57 PM6/6/13
to Jay Pipes, repo-d...@googlegroups.com
git clone ...
git fetch refs/meta/config
git checkout refs/meta/config
vi project.config

Duplicate the Verified label block (but give it a new name)

Git commit -a
git push HEAD:refs/meta/config

Restart Gerrit (or ssh host gerrit flush-caches --all)

Alex

Sent from my iPhone 5
> --
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Shawn Pearce

unread,
Jun 7, 2013, 11:41:08 AM6/7/13
to Alex Blewitt, Jay Pipes, repo-d...@googlegroups.com
On Thu, Jun 6, 2013 at 2:12 PM, Alex Blewitt <alex.b...@gmail.com> wrote:
> git push HEAD:refs/meta/config
>
> Restart Gerrit (or ssh host gerrit flush-caches --all)

If you do the push to Gerrit, there is no need to restart the server
or flush the caches.

If you push behind its back into the repository, Gerrit usually sees
the modification within 5 minutes of the reference being changed. This
time is controlled by gerrit.config variable
cache.projects.checkFrequency.

Jay Pipes

unread,
Jun 14, 2013, 1:41:44 PM6/14/13
to Alex Blewitt, repo-d...@googlegroups.com
On 06/06/2013 05:12 PM, Alex Blewitt wrote:
> git clone ...
> git fetch refs/meta/config
> git checkout refs/meta/config
> vi project.config

Am I missing something obvious here?

jpipes@uberbox:~/repos/att-cloud$ git clone att-gerrit:All-Projects.git
Cloning into 'All-Projects'...
remote: Counting objects: 4, done
remote: Finding sources: 100% (4/4)
Receiving objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0)
Note: checking out '819172fa56eec144fed63bc592ee4dfdf6d1dcd0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

jpipes@uberbox:~/repos/att-cloud$ cd All-Projects/
jpipes@uberbox:~/repos/att-cloud/All-Projects$ git fetch refs/meta/config
fatal: 'refs/meta/config' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Thanks,
-jay

Edwin Kempin

unread,
Jun 14, 2013, 1:45:42 PM6/14/13
to Jay Pipes, Repo and Gerrit Discussion, Alex Blewitt


On Jun 14, 2013 7:43 PM, "Jay Pipes" <jayp...@gmail.com> wrote:
>
> On 06/06/2013 05:12 PM, Alex Blewitt wrote:
>>
>> git clone ...
>> git fetch refs/meta/config
>> git checkout refs/meta/config
>> vi project.config
>
>
> Am I missing something obvious here?
>
> jpipes@uberbox:~/repos/att-cloud$ git clone att-gerrit:All-Projects.git
> Cloning into 'All-Projects'...
> remote: Counting objects: 4, done
> remote: Finding sources: 100% (4/4)
> Receiving objects: 100% (4/4), done.
> remote: Total 4 (delta 0), reused 0 (delta 0)
> Note: checking out '819172fa56eec144fed63bc592ee4dfdf6d1dcd0'.
>
> You are in 'detached HEAD' state. You can look around, make experimental
> changes and commit them, and you can discard any commits you make in this
> state without impacting any branches by performing another checkout.
>
> If you want to create a new branch to retain commits you create, you may
> do so (now or later) by using -b with the checkout command again. Example:
>
>   git checkout -b new_branch_name
>
> jpipes@uberbox:~/repos/att-cloud$ cd All-Projects/
> jpipes@uberbox:~/repos/att-cloud/All-Projects$ git fetch refs/meta/config
> fatal: 'refs/meta/config' does not appear to be a git repository

I think this should be
  git fetch origin refs/meta/config

> fatal: Could not read from remote repository.
>
> Please make sure you have the correct access rights
> and the repository exists.
>
> Thanks,
>
> -jay
>

Magnus Bäck

unread,
Jun 14, 2013, 1:47:44 PM6/14/13
to repo-d...@googlegroups.com
On Friday, June 14, 2013 at 13:41 EDT,
Jay Pipes <jayp...@gmail.com> wrote:

> Am I missing something obvious here?
>
> jpipes@uberbox:~/repos/att-cloud$ git clone att-gerrit:All-Projects.git
> Cloning into 'All-Projects'...
> remote: Counting objects: 4, done
> remote: Finding sources: 100% (4/4)
> Receiving objects: 100% (4/4), done.
> remote: Total 4 (delta 0), reused 0 (delta 0)
> Note: checking out '819172fa56eec144fed63bc592ee4dfdf6d1dcd0'.
>
> You are in 'detached HEAD' state. You can look around, make experimental
> changes and commit them, and you can discard any commits you make in this
> state without impacting any branches by performing another checkout.
>
> If you want to create a new branch to retain commits you create, you may
> do so (now or later) by using -b with the checkout command again. Example:
>
> git checkout -b new_branch_name
>
> jpipes@uberbox:~/repos/att-cloud$ cd All-Projects/
> jpipes@uberbox:~/repos/att-cloud/All-Projects$ git fetch refs/meta/config
> fatal: 'refs/meta/config' does not appear to be a git repository
> fatal: Could not read from remote repository.
>
> Please make sure you have the correct access rights
> and the repository exists.

Git thinks you want to fetch from the git identified by the relative
path refs/meta/config. Just include the name of the remote first:

git fetch origin refs/meta/config

That said, you don't need to do this. HEAD for All-Projects.git already
points to refs/meta/config so the correct commit has already been
checked out for you.

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

Jay Pipes

unread,
Jun 14, 2013, 2:10:29 PM6/14/13
to repo-d...@googlegroups.com
Thanks all for the explanations, that cleared things up.

Best,
-jay
Reply all
Reply to author
Forward
0 new messages