Explain git/git-lfs workaround in README
All checks were successful
builds.sr.ht/minimal_arch_test Job completed
builds.sr.ht/minimal_debian_test Job completed
builds.sr.ht/minimal_fedora_test Job completed
builds.sr.ht/full_debian_test Job completed
builds.sr.ht/website_deploy Job completed

git introduced some new security measures, which disable post-checkout hooks by
default. Since post-checkout hooks are used by git-lfs to download the large
files, this causes error messages to be printed at clone time.

As a result, we have updated the README to describe how to fix repositories
when this happens.

See #104 for more info.
This commit is contained in:
Matthew Fennell 2024-05-19 09:52:39 +01:00
parent 824c6982a9
commit a38be96910
Signed by: matthew
GPG key ID: AB49A7177B0ED3FE

View file

@ -48,6 +48,40 @@ If the instructions don't work on your distro, or there is no match, please let
us know! In the long term, we would like to try and support whatever
distributions are being used - especially those that are free software.
#### Failures during git clone
When cloning the repository, you may see this message:
```
fatal: active `post-checkout` hook found during `git clone`:
/tmp/motoristic/.git/hooks/post-checkout
For security reasons, this is disallowed by default.
If this is intentional and the hook should actually be run, please
run the command again with `GIT_CLONE_PROTECTION_ACTIVE=false`
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
```
If so, simply run
```
cd motoristic
git lfs pull
```
and the repository will be in a good state.
This happens because `git-lfs`, which we use to store large files in the
repository, works by creating a `post-checkout` hook in the repository, which
then downloads the large files. A recent change in `git` disables
`post-checkout` hooks from being run automatically for security reasons.
As of 2024-05-19, solutions are being discussed upstream. See this
[issue](https://github.com/git-lfs/git-lfs/issues/5749) in `git-lfs` for more.
[TODO #104](https://source.motoristic.org/motoristic/motoristic/issues/104)
tracks this in our repository.
### Full development environment
The process for setting up a full environment is almost identical to setting up