openSUSE / openSUSE-git

3 stars 5 forks source link

git hook to warn about missing lfs hooks initialization #28

Open dirkmueller opened 1 year ago

AdamMajer commented 1 year ago

This turns out to be a chicken and egg problem. The hooks are not cloned from remote.

The good news is we can have server side hooks that can verify that wrong files are not included in the repository and are actually part of LFS. But this will not help noobies that have no idea what LFS is when they try to clone our sources.

JanZerebecki commented 1 year ago

Maybe there is a way to register a system wide hook on installing osc...

JanZerebecki commented 1 year ago

The server side post-receive hook can print a message to make sure to run whatever command to ensure lfs is set up and fix the current branch.

Also when osc is installed it could add a hook to setup lfs on clone, but I have not tested that this works:

mcepl commented 1 week ago

Just to make a note here, lest we forget, that we should also set up pushurl to make AGit work:

[remote "origin"]
        url = https://src.opensuse.org/pool/foo
        pushurl = gitea@src.opensuse.org:pool/foo.git
        fetch = +refs/heads/*:refs/remotes/origin/*