Developers’ Weblog

FOSS hosting by
HostEurope Logo

Developers’ Weblog

All 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

So… edugit? gitlab? ruby? maintainer scripts? RoDD/QA?

2019-08-28
Tags: bug debian personal rant work

So… the Debian package of gitlab is too buggy to be used (was built against ruby-asciidoc version X.Y while sid carries X.(Y+1) now, which causes it to bug around, of course, as proper for an immature language like that. So, someone decided to switch to the GitLab CE *.deb format packages (not Debian packages — not Free; just Open Core but Debian itself uses those for its “Salsa” instance as well (which is, incidentally, why I refuse use of that whenever possible) and, for that, removed the Debian packages. The gitlab binary package helpfully offered to not delete the repositories, but gitlab-common’s postrm not only removed the user account (a big no-no!) but used the option to delete its home directory… which is where the git repositories and project icons and the likes are stored under. (Note that undeleting from ext3/4 is hard, unlike ext2, and if fsck and/or a journal replay is run, chances get worse… the ext4undelete tool “helpfully” requires an fsck run… ’nuff said… if you ever accidentally delete something, immediately unplug power and destroy VMs hard, then snapshot the filesystem so multiple rescue approaches aren’t made impossible.)

Anyway, it’s apparently running GitLab CE now, which means that all the remotes have changed. I used this…

	sudo find / -xdev -name config | grep '/\.git/config$' >~/xgc
	sudo fgrep -li gitlab@edugit.org $(<~/xgc) >~/xgc2
	<~/xgc2 sudo xargs perl -pi -e 's/gitlab\@edugit.org/git\@edugit.org/gi'

… for fixing up mine (inspect the temporary files and check find(1) and mount(8) for -xdev to get the right files found).

Also, ~/.gitconfig insteadOf / pushInsteadOf need fixing. Let me plug an undercover avertisement for my .gitconfig here, which contains examples for insteadOf as well as commands to download GitLab merge and GitHub pull requests.

After having fixed those up, go to the web UI and click on “Create empty repository”, then push all remote branches recorded in your hopefully up-to-date clone and (all) tags to the instance:

	remote=origin
	git branch -r | sed -n "/^  $remote\\//s///p" | \
	    while read branchname rest; do
		test x"$branchname" = x"HEAD" && continue
		echo "pushing $remote/$branchname"
		git push "$remote" "$remote/$branchname:refs/heads/$branchname"
	done
	git push "$remote" --tags

Adjust the remote variable if necessary. Run this in all clones you have access to; not using force pushes makes only those pushes which actually add commits succeed. All repositories hosted on the edugit instance are affected and need(ed) restoring, which, thankfully, appears to make everything else, like stored merge requests, work again (although the project and group logos are gone, which need re-uploading). That being said, unapplied merge requests are stored in special refs which are not normally cloned… so they’re gone now.

MirBSD Logo