fracz/git-exercises

Push is failing with gc error

Hufschmidt opened this issue · 1 comments

Hi,

first of all thank you for taking the time to build this exercises. 😃

I was testing them so I might recommend them to some fellow colleagues that are new to git, but currently git verify does not seem to work, eg.

$ git verify
You haven't made any progress on exercise commit-one-file-staged.
Did you forget to commit your changes?

I think the issue is that push is rejected with an error, eg.

$ git push
Objekte aufzählen: 4, Fertig.
Zähle Objekte: 100% (4/4), Fertig.
Delta-Kompression verwendet bis zu 6 Threads.
Komprimiere Objekte: 100% (2/2), Fertig.
Schreibe Objekte: 100% (3/3), 300 bytes | 300.00 KiB/s, Fertig.
Gesamt 3 (Delta 0), Wiederverwendet 0 (Delta 0)
remote: (
remote: ************************************************************************
remote: Exercise: commit-one-file
remote: Status: PASSED
remote: You can see the easiest known solution and further info at:
remote: https://gitexercises.fracz.com/e/commit-one-file/4xq
remote: 
remote: Next task: commit-one-file-staged
remote: In order to start, execute: git start next
remote: 
remote: See your progress and instructions at:
remote: https://gitexercises.fracz.com/c/4xq
remote: ************************************************************************
remote: )
remote: Remember that you can use git verify to strip disturbing output.
remote: error: hook declined to update refs/heads/commit-one-file
remote: error: The last gc run reported the following. Please correct the root cause
remote: and remove gc.log.
remote: Automatic cleanup will not be performed until the file is removed.
remote: 
remote: warning: There are too many unreachable loose objects; run 'git prune' to remove them.
remote: 
To https://gitexercises.fracz.com/git/exercises.git
 ! [remote rejected] commit-one-file -> commit-one-file (hook declined)
error: Fehler beim Versenden einiger Referenzen nach 'https://gitexercises.fracz.com/git/exercises.git'

My guess is that you need to add automatic garbage collection to your backend git-server, eg. as post-push hook.

The generated link (eg. https://gitexercises.fracz.com/c/4xq) does work however, pushing a solution does increase your progress.
So it seems its only an issue with git push failing unexpectedly (due to to many unreachable loose objects)

fracz commented

Thank you for the inspection and the suggestiong. Have launched git gc and git prune now manually and added this to the crontab. Should be working now :-)