Re: Be more careful about updating refs
From: Sam Vilain <hidden>
Date: 2016-06-15 22:44:08
Linus Torvalds wrote:
Perhaps more importantly, it also refuses to update a branch head with a non-commit object. I don't quite know *how* the stable series maintainers were able to corrupt their repository to have a HEAD that pointed to a tag rather than a commit object, but they did. Which results in a totally broken repository that cannot be cloned or committed on.
I actually used this for a prototype system to allow push over git:// with secure authentication via PGP; basically it used an update hook that disallowed any ref change that wasn't a signed tag, and then in the post-update hook, moved the tag to an audit log refspace and put the referant commit in the refs/heads/* location. The hooks (probably racy etc) can be seen under http://git.utsl.gen.nz/Tangram/hooks Sam.