www-infrastructure-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Rosenvold <kristian.rosenv...@gmail.com>
Subject Re: Git, history, protection, and other topics
Date Wed, 04 Nov 2015 13:12:39 GMT
Technically all you need to do is have a push hook that creates a
"historic" reference to any branch being rewritten or deleted. Put
these in a separate (non-default) folder in "refs" in the hook, and
you'll have all historic non-forward references "archived" within the
repository. When a regular user does git clone, the history does not
get included. But you can add a manual statement to fetch the complete
history.

git config --add remote.origin.fetch
"+refs/archived/*/head:refs/remotes/origin/archived/*"

If you do something like this, anyone wishing to audit the complete
history can do so in their favourite git viewer.

You'd probably want to script the push hook to add some kind of
date/time stamp to the branch name when it's pushed to historic.

Kristian

Mime
View raw message