Search code examples
gitolite

See available users in Gitolite


Sometimes it is not clear what username a certain gitolite user has. If people want to control access rights for their wild repos, they need to know the usernames. One obvious solution would be to ask them for their usernames. In our environment the most common case is that the admin is asked for usernames, since sometimes the users themselves do not know their usernames.

This is a bit inconvenient and I would like to know whether is an easy solution, e.g. a command that displays all available usernames. If not, are there any suggestions on how to write such a script and how to access it?


Solution

  • I added a new command 'usernames' that simply prints a text file that contains all usernames with respective real names. I put this file in the main directory of the gitolite-admin-repo. Only drawback is that this file requires manual updating after a new user is added.

    Put this in ~/gitolite-source/src/commands/usernames:

    #! /bin/bash
    
    cat $HOME/.gitolite/usernames.txt