Is there anyway to see a list of registered users on a Gerrit site

753 views
Skip to first unread message

Rajesh Babhulkar

unread,
Mar 16, 2024, 3:52:11 AM3/16/24
to Repo and Gerrit Discussion
Is there anyway to see a list of registered users on a Gerrit site ? 
as the databse changed the following gsql command do not work. what is the new way?
gerrit gsql --format PRETTY -c "select full_name,preferred_email from accounts 

Thanks and Regards,
Rajesh

Matthias Sohn

unread,
Mar 16, 2024, 4:14:46 AM3/16/24
to Rajesh Babhulkar, Repo and Gerrit Discussion
You can use an accounts query using some search predicate (e.g. is:active)
 
Thanks and Regards,
Rajesh

--
--
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/7cd9cf2a-56e3-491a-b29e-848e4b528d43n%40googlegroups.com.

Rajesh Babhulkar

unread,
Mar 16, 2024, 5:50:35 AM3/16/24
to Repo and Gerrit Discussion
Hi Sohn, Thanks. I am able to the active members account id. But how can I get the email ids?

Thanks and Regards,
Rajesh

Rajesh Babhulkar

unread,
Mar 16, 2024, 5:58:19 AM3/16/24
to Repo and Gerrit Discussion
Also I am able to the email using the account id. But it is working only for single account id at a time. I am looking for a command which list all the registered users.

Thanks and Regards,
Rajesh

Luca Milanesio

unread,
Mar 16, 2024, 7:41:26 AM3/16/24
to Repo and Gerrit Discussion, Luca Milanesio
Hi Rajesh,

> On 16 Mar 2024, at 09:58, Rajesh Babhulkar <rbabh...@gmail.com> wrote:
>
> Also I am able to the email using the account id. But it is working only for single account id at a time. I am looking for a command which list all the registered users.


Why don’t you just look at the All-Users git repository?
It’s very easy because you can just look at the refs/users/* and their status.

Example:

git show-ref | grep users
2b2d682b2274d3a16815cb87a3d2ff040880a1c0 refs/users/00/1000000

Then you just look at the history of the ref and check if you had the following change 'active = false’, which means that the user was disabled.

HTH

Luca.
> To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/0d9a7925-62ec-436a-9dbb-47b24e4e7f14n%40googlegroups.com.


Matthias Sohn

unread,
Mar 16, 2024, 10:36:27 AM3/16/24
to Rajesh Babhulkar, Repo and Gerrit Discussion
On Sat, Mar 16, 2024 at 10:58 AM Rajesh Babhulkar <rbabh...@gmail.com> wrote:
Also I am able to the email using the account id. But it is working only for single account id at a time. I am looking for a command which list all the registered users.

Did you read the documentation I referenced ?
You can add an option to get the emails, e.g.


If you need more details use DETAILS instead:


As mentioned in the documentation this requires the caller to have the Modify Account global capability.

-Matthias
 

Rajesh Babhulkar

unread,
Mar 17, 2024, 10:38:10 AM3/17/24
to Repo and Gerrit Discussion
Hi Matthias,

Thanks! It works.

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "https://<gerrit host>/accounts/?q=is:active&o=DETAILS" --user "<user name>:<password>"

Thanks and Regards,
Rajesh
Reply all
Reply to author
Forward
0 new messages