On Wed, Jul 01, 2020 at 01:54:33PM -0700, Craig de Stigter wrote:
>
> Hi folks
>
> We've started using the batch mode of the perms command to set perms from
> an external system.
>
> One problem is that the batch mode requires `-c`, which creates the repo if
> it doesn't exist. However, not all of the objects in our system have repos
> attached, and we don't want to create useless empty repos.
>
> So at present we first have to check if the repo exists, and then we can
> run the perms command with -c.
Just to recap, "perms -c" works like this:
cat copy-of-backed-up-gl-perms | ssh git@host perms -c <repo>
and it creates the repo if needed.
I'm trying to understand why you would need to run a "perms -c"
against a repo that you do NOT want to create. Why should
anyone be passing reponames to gitolite that should not exist?
That is a somewhat strange use case, and I am not convinced that
gitolite needs to support it in the upstream version.
Note that commands (and triggers) are not considered "core", and
gitolite explicitly allows you to override shipped commands with
your own variants; see [1] and perhaps also [2].
So you can always replicate the `perms` script on your own
installation, with lines 57 to 65 replaced with a simple `exit;`
(not tested; please test!)
Hope this helps. If I have totally misunderstood the problem
please add some details to help me understand!
[1]:
https://gitolite.com/gitolite/non-core.html
[2]:
https://gitolite.com/gitolite/cookbook.html#adding-your-own-commands
regards
sitaram