automatically add hook when adding repository