Submodules and the gitolite-admin

15 views
Skip to first unread message

Tomas Volf

unread,
Jan 6, 2024, 8:15:18 PMJan 6
to gito...@googlegroups.com
Hello,

I would like to ask how does the gitolite-admin repository behaves when I put a
git submodule into it. Will that submodule be cloned/update when I push the
gitolite-admin? Will gitolite just ignore that the submodule is there?
Something else?

I searched the docs but did not find anything.

Thank you and have a nice day,
Tomas Volf

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
signature.asc

Sitaram Chamarty

unread,
Jan 6, 2024, 8:20:26 PMJan 6
to Tomas Volf, gito...@googlegroups.com
On Sat, Jan 06, 2024 at 08:27:54PM +0100, Tomas Volf wrote:
> Hello,
>
> I would like to ask how does the gitolite-admin repository behaves when I put a
> git submodule into it. Will that submodule be cloned/update when I push the
> gitolite-admin? Will gitolite just ignore that the submodule is there?
> Something else?

I have to admit I never needed submodules enough to make the
effort to understand them.

However, gitolite should behave exactly as a normal ssh-based
git server for any repo, so submodules for your repos should be
fine.

If you're asking specifically about the gitolite-admin repo,
there is no support for it. Could you explain what you were
intending to do/achieve; maybe there's some other way to do it I
can think of?

sitaram

Tomas Volf

unread,
Jan 7, 2024, 9:44:36 AMJan 7
to Sitaram Chamarty, gito...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 2024-01-07 06:50:20 +0530, Sitaram Chamarty wrote:
> On Sat, Jan 06, 2024 at 08:27:54PM +0100, Tomas Volf wrote:
> > Hello,
> >
> > I would like to ask how does the gitolite-admin repository behaves when I put a
> > git submodule into it. Will that submodule be cloned/update when I push the
> > gitolite-admin? Will gitolite just ignore that the submodule is there?
> > Something else?
>
> I have to admit I never needed submodules enough to make the
> effort to understand them.
>
> However, gitolite should behave exactly as a normal ssh-based
> git server for any repo, so submodules for your repos should be
> fine.
>
> If you're asking specifically about the gitolite-admin repo,
> there is no support for it.

That is great to hear! After reading your message, I gave it a try, and indeed,
the submodule is being ignored, just as I need.

> Could you explain what you were intending to do/achieve; maybe there's some
> other way to do it I can think of?

Technically I did achieve exactly what I needed, but will explain anyway.

Over the last weekend, I was looking into setting up cgit on my server, and that
involved getting my repositories over to the machine where it would be running.
Hence my original research into hooks in gitolite. However, gitolite has
mirroring functionality already built-in (as I learned), so I ended up using it
instead of custom hook. It works very nicely, but it requires two
gitolite-admin repositories (one on the master, one on the slave).

Few issues with that:
1. some parts of the repositories need to be kept in sync
2. the slave's configuration needs to be pushed first
3. the content is very repetitive

So I introduced my own generator for the configuration, which reduces:

repo xxx
RW+ = me
R = daemon
option mirror.master = master
option mirror.copies = slave
config gitweb.description = Some desc
config gitweb.category = Cat
config gitweb.owner = me
config http.receivepack = false

into

("xxx"
. ((desc . "Some desc")
(category . "Cat")))

So now I can generate both configurations with just ./generate, and only
appropriate parts are put into each gitolite.conf.

The remaining issue was how to track and version it. I ended up with this
directory structure (irrelevant parts like keydir left out):

gitolite-admin
├── conf
│   └── gitolite.conf
├── generate
└── gitolite-admin-slave <----- submodule
└── conf
└── gitolite.conf

That seems to work great and reminds me to push the slave configuration first,
however, and we are getting back to my question, I was not sure if it would
actually work.

The master server does *not* have access to slave's gitolite-admin (not even R),
because it does not need it. So if gitolite would try to clone out the
submodule, it would fail.

So to state it once more: current behavior is perfect for me and thank you for
confirming it.

Also, I would like to use this opportunity to say thanks for all the work you do
on gitolite, it is great and reliable software.

Have a nice 2024,
Tomas Volf

- --
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWauM4ACgkQL7/ufbZ/
wanR/w/8DDXohxxXbd3Ms+oWQDkoAE6zvdu5j1NOwLye/Y/NmtKHFJa8Cx+LDB+c
2wd6YieXlXMZwngYbPCOf2QNiyLJdnOxQbU8Mkaym6eW6ChZ8Wvufd19TlZGqRxk
Tzn915B3yt3dHTaLoohKNkbdPHAX67FnkC1s+7psoUVBbHgkyL5b4Y9LYr0D5G8J
/y3XcpfJu4LCBrBgzfTP6i1oCZn+FOWEMM2PGgR6Jr0xQ9D9+gZgvS82H6svJ1UK
Zlrolu416Tp1oMP84HPIo3MbiZQ4F2xJKa6rm6kTCHXRSs8WzqWdpx6wJ6nIjKVc
sLrPYvyYOzdQWWxHoxrS21r8vSYelpAuMDDlSngqQpSdw+t9EtAVO9xil2XncRZD
HgptFoHM3rN2EW0xQ9O5ir9tJCS1Hk9yyA056e2By9EshlRwzcaL/t9WCveuzlEf
dm7pa8iIw7KpyH05nN788cP5D3WQPtIGFXjS9AHvPEc1SCYbIzFvi7w+258GOffh
wJrHuMid1wSvRjVCtPu49C+GoSBwALrPJ9suNXZgjZdP3brH2+Lx7NvhSdBMz9/q
BQJsCUKYIFXaXqD7x5yqZpXOUw/i9avznvu98b9lq1TBkUp/wL3y0S2l/iSyhxQd
+gvzHUl9bWLf99McHdTEr7R644anQu/cikSQXNDaLJLtAkhvHdU=
=DeNJ
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages