We have a central git bare, which all users clone from and we use it for sync between the users.
Currently this directory has become huge, and we want to delete it's old history.
The problem is that deleting the history will change the hashing of the kept commits.
I want to use the "pre-receive
" hook to detect that the user is trying to push from a new clone and not an old one before the change.
The command "git rev-list --max-parents=0 HEAD
" should give me the hash if the first commit, the problem is that when pre-receive is executed we are already in the bare repo, and i need to determine also what is the starting point of the user data.
So, how can I know what is the user directory?