ratfactor/ziglings

Announcement! We've moved to Codeberg

ratfactor opened this issue ยท 16 comments

As you can see in the README, we've moved Ziglings to Codeberg. The move is for ideological reasons.

Since the only requirement for actually using Ziglings is the ability to clone the repo, this should have no major effect beyond a change of URL when doing a git clone to get started.

The question is: what should we do with this GitHub version? We could make it a mirror of the Codeberg repo. Or we could archive it. Perhaps there is some third option?

Thanks!

Hi @ratfactor, May I know why it has been moved to other hosting site ?

ee7 commented

I think a mirror sounds best for now. If the GitHub repo is only archived, people who simply run git pull locally sometimes may not notice the migration, and assume that Ziglings wasn't updated recently.

However, I notice that the Codeberg repo history is entirely new - the oldest commit is from last week. I was expecting that the main branch of the new repo would contain every commit from the main branch in the GitHub repo. Is there a good reason for the fresh start? Some disadvantages are that it:

  • Makes it hard for current Ziglings users to migrate
  • Makes it hard for the GitHub repo to be a mirror of the Codeberg repo
  • Gives up information in commit messages
  • Gives up the ability to usefully git blame, git bisect, etc
  • Destroys contributor information

Previously, the natural way to use Ziglings was:

  1. Clone the GitHub repo
  2. Create a new branch locally
  3. Solve exercises
  4. Pull the main branch sometimes

But if the git history is not preserved, previous users cannot easily:

  • Add https://ziglings.org as a new remote to their local Ziglings repo
  • Or migrate their local solutions branch
  • Or run git pull as usual in their local repo

Instead, previous users are mostly forced to clone the new repo.

Could we please make the Codeberg repo contain the GitHub repo history? To be concrete: can we base new Ziglings development on top of the latest commit (7417f01) in the GitHub repo, and force-push to the main branch of the Codeberg repo?

Could we please make the Codeberg repo contain the GitHub repo history? To be concrete: can we base new Ziglings development on top of the latest commit (7417f01) in the GitHub repo, and force-push to the main branch of the Codeberg repo?

Thanks for the tip, I was able to implement that.

Hi @ratfactor, May I know why it has been moved to other hosting site ?

Yes, it's because I do not believe GitHub has the best interests of independent/FOSS developers at heart. It is a for-profit company and we are the product.

For a longer explanation: http://ratfactor.com/leaving-github

(I know it'll be hard, but please try to not get hung up on the 2FA part.) ๐Ÿ˜„

ee7 commented

Could we please make the Codeberg repo contain the GitHub repo history? To be concrete: can we base new Ziglings development on top of the latest commit (7417f01) in the GitHub repo, and force-push to the main branch of the Codeberg repo?

Thanks for the tip, I was able to implement that.

Thanks. Much better than before.

But to nitpick, it looks like the git history isn't exactly identical. It seems that:

  • The git history in Codeberg is now "compatible" in the sense that git pull should work (although this might depend on the user's git config) after a user changes the remote URL in their local repo.
  • The repos have the same root commit.

But commits after 5b47e8e have different refs on Codeberg. Can we fix that? Otherwise, for example:

  • It'll be harder to turn GitHub into a mirror of Codeberg, if that's desired.
  • Mentions of old commit refs in commit messages may no longer work.

The latest commit on GitHub is 7417f01, but linking to the same ref in the Codeberg repo is a 404. Ideally, the latter link should work.

Please see the below script for a demonstration
#!/usr/bin/env bash

set -e

rm -rf /tmp/ziglings-github /tmp/ziglings-codeberg
codeberg_url='https://codeberg.org/ziglings/exercises'
cd /tmp

(
  printf "Cloning ziglings from GitHub...\n"
  git clone --quiet https://github.com/ratfactor/ziglings ziglings-github

  cd ziglings-github

  printf "\nRoot commit on main:\n"
  git rev-list --max-parents=0 HEAD

  printf "\nLatest commit on main:\n"
  git log -n1

  printf "\norigin remote before migration:\n"
  git remote -v

  # Migrate remote to new URL
  git remote set-url origin "${codeberg_url}"

  printf "\norigin remote after migration:\n"
  git remote -v

  printf "\nPulling main...\n"
  git pull origin main

  printf "\nLatest commit on main:\n"
  git log -n1
)

(
  printf "\n=================================\n"
  printf "\nCloning ziglings from Codeberg...\n"
  git clone --quiet "${codeberg_url}" ziglings-codeberg

  cd ziglings-codeberg

  printf "\nRoot commit on main:\n"
  git rev-list --max-parents=0 HEAD

  printf "\nShowing an old commit from GitHub...\n"
  git log -n1 5b47e8ebe6cee0b89dbfe5a2ee413f83d3b7e4e0

  printf "\nTrying to show the commit that comes after the above one...\n"
  git log -n1 7310242ef0d72936ecbfb19014ada896f1b57f2a
)
And its output
Cloning ziglings from GitHub...

Root commit on main:
3b5678815f010bd016ca561e4672d2d83271cb2e

Latest commit on main:
commit 7417f01d5d8fa8bed84849684501c71b821dff68 (HEAD -> main, origin/main, origin/HEAD)
Author: Dave Gauer <ratfactor@gmail.com>
Date:   Tue Sep 19 20:51:05 2023 -0400

    Update README.md with new clone instructions

origin remote before migration:
origin	https://github.com/ratfactor/ziglings (fetch)
origin	https://github.com/ratfactor/ziglings (push)

origin remote after migration:
origin	https://codeberg.org/ziglings/exercises (fetch)
origin	https://codeberg.org/ziglings/exercises (push)

Pulling main...
remote: Enumerating objects: 3184, done.
remote: Counting objects: 100% (3167/3167), done.
remote: Compressing objects: 100% (1158/1158), done.
remote: Total 3142 (delta 1936), reused 3088 (delta 1891), pack-reused 0
Receiving objects: 100% (3142/3142), 657.73 KiB | 3.48 MiB/s, done.
Resolving deltas: 100% (1936/1936), completed with 19 local objects.
From https://codeberg.org/ziglings/exercises
 * branch            main       -> FETCH_HEAD
 + 7417f01...f29a42b main       -> origin/main  (forced update)
Successfully rebased and updated refs/heads/main.

Latest commit on main:
commit f29a42b5f187fa338394f53b826ec131892014cf (HEAD -> main, origin/main, origin/HEAD)
Author: ratfactor <ratfactor@noreply.codeberg.org>
Date:   Wed Sep 20 13:10:08 2023 +0200

    Update README to announce move to Codeberg!

=================================

Cloning ziglings from Codeberg...

Root commit on main:
3b5678815f010bd016ca561e4672d2d83271cb2e

Showing an old commit from GitHub...
commit 5b47e8ebe6cee0b89dbfe5a2ee413f83d3b7e4e0
Author: Dave Gauer <dave@ratfactor.com>
Date:   Wed Feb 10 21:44:11 2021 -0500

    Removed incorrect explanation of assignment error (#1)

    It really has nothing to do with the if/else expression. The peer
    types are being resolved correctly.  The same error can be produced
    with something as simple as:

        var foo = 5;

Trying to show the commit that comes after the above one...
fatal: bad object 7310242ef0d72936ecbfb19014ada896f1b57f2a

But commits after 5b47e8e have different refs on Codeberg.

Actually, no. The refs usually take place via email. And if someone has changed his email, or uses a 'noreply' from Github, then the link breaks. But as far as I can tell, the entries are the same.

The latest commit on GitHub is 7417f01, but linking to the same ref in the Codeberg repo is a 404. Ideally, the latter link should work.

The link has gone because of adapting the README to the current Zig version. After that I made the changes from ratfactor again.

ee7 commented

Sorry, I should've written more clearly.

Commit 7310242 from 2021-02-11 exists on the main branch in the GitHub repo, so I'd expect the below link to work:

https://codeberg.org/ziglings/exercises/commit/7310242ef0d72936ecbfb19014ada896f1b57f2a

But that link doesn't work, because that commit sha (and the sha of every commit after it) does not exist in the Codeberg repo. Are you saying that's expected?

I didn't understand the part about email addresses. It's true that a commit's hash depends on the author email and the committer email, but I was expecting the commits on Codeberg to be identical. I think the email addresses in every commit should be preserved, even if they contain some GitHub noreply addresses, right?

Sorry, I should've written more clearly.

Thanks, now I understand your point. On my local git repository the entries are valid but after I copied it to codeberg they are lost. I try to figure out why.

Now I know why this no longer works. Commits from different branches were only taken over in the final phase, so the original commits no longer resolve. Codeberg offers the possibility to migrate them as well, so that the complete repository is restored. This would then also make the links work, but that means another enormous effort.
And is it worth it?

Codeberg is noticeably slower than Github:

  • forking
  • preview of changes before commit - still generating after couple of minutes

Also on first fork I got 500.

And is it worth it?

If I might add my 2 cents, yes it is. I consider history the most important point of ... working with git, so it would be nice to not lose it.

Also, while I (somewhat) understand your point about moving (especially on the burnout aspect), I would appreciate if you would make the GitHub repo a mirror of the main Codeberg. I don't intent (and honestly can't/don't want) to invest the required extra time to track projects being developped outside of GitHub.

Registration is closed at codeberg.org, what is the plan for new contributors (pull requests)?

Registration is closed at codeberg.org, what is the plan for new contributors (pull requests)?

This is surely temporary. I see this message if I try to register on codeberg.org right now:

Registration is disabled. Please contact your site administrator.

I certainly don't speak for Codeberg, but I know they're having some growing pains right now. It might get even worse when GitHub starts actually limiting accounts that don't have 2FA enabled. Same thing happens on Mastodon servers when the big social media sites go bad. Tons of new registrations. Give them time to catch up.

Worst case, you can send us a patch by email. (Address in commit history.) :-)

Registration is closed at codeberg.org, what is the plan for new contributors (pull requests)?

This is surely temporary. I see this message if I try to register on codeberg.org right now:

Registration is disabled. Please contact your site administrator.

I certainly don't speak for Codeberg, but I know they're having some growing pains right now. It might get even worse when GitHub starts actually limiting accounts that don't have 2FA enabled. Same thing happens on Mastodon servers when the big social media sites go bad. Tons of new registrations. Give them time to catch up.

Worst case, you can send us a patch by email. (Address in commit history.) :-)

Thanks for clarification.

Now I know why this no longer works. Commits from different branches were only taken over in the final phase, so the original commits no longer resolve. Codeberg offers the possibility to migrate them as well, so that the complete repository is restored. This would then also make the links work, but that means another enormous effort.
And is it worth it?

Is this planned to be ever fixed? That issue pretty much stopped my work on ziglings because of the issues mentionned above.
At the very least, do you plan to mirror the content of the codeberg repo (with the new hashes) on GitHub?

Moved to #366 for visibility.