git pre-receive hook original directory -
we have central git bare, users clone , use sync between users.
currently directory has become huge, , want delete it's old history.
the problem deleting history change hashing of kept commits. want use "pre-receive" hook detect user trying push new clone , not old 1 before change.
the command "git rev-list --max-parents=0 head" should give me hash if first commit, problem when pre-receive executed in bare repo, , need determine starting point of user data.
so, how can know user directory?
you don't have information origin of push.
you could check commit message in hook, in order check pre-defined policy says:
from on, if want push repo, need include information in commit message allowing central repo identify first commit of downstream repo.
but requires communication users in order put in place.
not git enforce on own.
Comments
Post a Comment