gitolite-admin push does not update config

43 views
Skip to first unread message

Asenar

unread,
Dec 16, 2024, 8:43:38 AM12/16/24
to gitolite
Hello all, 

on a fresh gitolite install, the config does not update on gitolite-admin push

I just installed gitolite on my server: I created a user named `git` then, as this user I followed the installation steps on https://github.com/gitolite/gitolite :
* cloned the repo
* gitolite install
* gitolite -pk michael.pub

Then I 
* cloned the repository `gitolite-admin` on my local drive, 
* added a repository `myNewProject` and another user public key
* pushed the changes

And the gitolite configuration has not been updated: when I try to clone the new project, the server answer the repository does not exists (and the user I added cannot fetch / push either). `ssh git@my-server info` show only `gitolite-admin` and `testing` repositories.

When I check the server, I see no changes in the /home/git/.gitolite/ config.

I found how to workaround like this:
On the server side and as user `git`, I have to:
1) edit manually `.gitolite/conf/gitolite.conf`
2) run `bin/gitolite setup`


Can you help me to figure out what's wrong ?

Ken Hornstein

unread,
Dec 16, 2024, 9:46:33 AM12/16/24
to Asenar, gitolite
>And the gitolite configuration has not been updated: when I try to clone
>the new project, the server answer the repository does not exists (and the
>user I added cannot fetch / push either). `ssh git@my-server info` show
>only `gitolite-admin` and `testing` repositories.

Did you try checking the gitolite logs?

My limited, imperfect understanding of how that is SUPPOSED to work is
there is a post-update hook in the gitolite-admin repo, which should
be $GITHOME/repositories/gitolite-admin/hooks/post-update that is
supposed to be called by the git server process after any changes to the
gitolite-admin repo and do the necessary updates. If that's not happening
then maybe the hook is missing for some reason, or the git server process
isn't calling it for some reason, or there is some kind of permission
problem.

Also, if you are up for it, maybe system call tracing the gitolite process
when you are coming in via ssh to see how that is different.

--Ken

Andrejs Kostromins

unread,
Jan 30, 2025, 6:59:21 AMJan 30
to gitolite
Hello,

I straggled with getting gitolite to update users and repos after pushing changes last evening. However, this morning came with successful experimenting and finding the reason (some credit goes to ChatGPT as well :) ). Actually in my case there were two issues:

1. Since I followed installation manual and setup by cloning gitolite I wound out that at least one ENV variable is not set. Thus the hooks could not find path to lib because of: use lib $ENV{GL_LIBDIR};
I found this by manually triggering /home/git/.gitolite/hooks/gitolite-admin/post-update
So I tested by manually pointing to /home/git/bin/lib instead of $ENV{GL_LIBDIR}
But it was not all.

2. Second issue was very very tricky. Gitolite is expecting `master` as main branch, while VS Code pushed `main`. Gitolite simply did nothing, because it did not find `master` in my fresh push.

Don't be harsh if I missed something in installation manual, but I am pretty sure I followed every step.

Regards,
Andrejs

Andrejs Kostromins

unread,
Jan 30, 2025, 6:59:21 AMJan 30
to gitolite
Hi Asenar,

Any progress on this matter?
I have tried several times with fresh installs etc. using apt install and git clone approach, still have the same issue you have described.

I did not try workaround just because I am aiming to get it working as it suppose to work.

Sitaram Chamarty

unread,
Jan 30, 2025, 7:04:19 AMJan 30
to Andrejs Kostromins, gitolite
Sorry I've been (and still am) away from my personal dev env -- too much travel and other stuff for too long.

Can you check if the patch in this message works for you?  I'd be happy to roll it in if it works.  Link: https://groups.google.com/g/gitolite/c/o6fFwcCZb_E/m/G4Ry7rQiAAAJ

--
You received this message because you are subscribed to the Google Groups "gitolite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitolite+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gitolite/73266bad-0920-44c2-a65d-358c1d5120b7n%40googlegroups.com.


--
Sitaram

Andrejs Kostromins

unread,
Jan 30, 2025, 7:29:27 AMJan 30
to gitolite
Well... I already reconfigured remote server for 'master' as default name instead of 'main' and setup gitolite for some 6th or 7th time :) Since it is the fresh remote server setup I can leave with 'master' instead of 'main'.

Regards,
Andrejs

Ken Hornstein

unread,
Jan 30, 2025, 8:35:27 AMJan 30
to Andrejs Kostromins, gitolite
>1. Since I followed installation manual and setup by cloning
>gitolite I wound out that at least one ENV variable is not
>set. Thus the hooks could not find path to lib because of:
>*use lib $ENV{GL_LIBDIR};* I found this by manually triggering
>*/home/git/.gitolite/hooks/gitolite-admin/post-update* So I tested by
>manually pointing to */home/git/bin/lib* instead of *$ENV{GL_LIBDIR}*
>But it was not all.

FWIW, this shouldn't be an issue in normal usage. GL_LIBDIR is supposed
to be set by the gitolite-shell command at the very beginning of it:

use FindBin;

BEGIN { $ENV{GL_BINDIR} = $FindBin::RealBin; }
BEGIN { $ENV{GL_LIBDIR} = "$ENV{GL_BINDIR}/lib"; }
use lib $ENV{GL_LIBDIR};

And since in normal usage everything is supposed to be going through
gitolite-shell, the hooks should get that. You could put some debugging
print commands in either the hook or gitolite-shell to see if FindBin
is getting the wrong pathname for some reason. If the value is set
correctly in gitolite-shell, then perhaps something is cleaning the
environment down to the hook.

>2. Second issue was very very tricky. Gitolite is expecting `master` as
>main branch, while VS Code pushed `main`. Gitolite simply did nothing,
>because it did not find `master` in my fresh push.

Ah, I guess that's only an issue for the gitolite-admin repo; didn't
know about that one.

--Ken

michael marinetti

unread,
Mar 3, 2025, 7:27:10 PMMar 3
to gitolite, sita...@gmail.com
Hello all,

And sorry for the late answer,

Andrejs, my case was exactly (and simply) the second one.

Sitaram, thanks you very much for the patch, it worked perfectly !

I just applied it on the server repo, made a commit --amend to my local gitolite-admin repository, and saw the repository created in the output (and I can confirm it server side)

Indeed the issue was related to the default branch name that is `main` instead of the old `master`.

Thanks again for your help. To support you, can I buy the book anywhere or is it specially on packtpub ? (sidenote: the link on the website is incorrect).
I first used gitolite in 2010 when I had to share some code with others, and it helped me a lot.
Then I used for years for deployment on my «small» server.


Michaël


--
You received this message because you are subscribed to a topic in the Google Groups "gitolite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gitolite/w8ZYosB-mZw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gitolite+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gitolite/679b801d.050a0220.e38d7.3bb8SMTPIN_ADDED_MISSING%40gmr-mx.google.com.
Reply all
Reply to author
Forward
0 new messages