refs: add option core.logAllRefUpdates = always
authorCornelius Weig <cornelius.weig@tngtech.com>
Fri, 27 Jan 2017 10:09:47 +0000 (11:09 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 Jan 2017 18:01:24 +0000 (10:01 -0800)
commit341fb28621201c5e6c9d3fee5baf7c532fa8a618
tree1968a421d74a50dcc53304dd0196af5cf76b8d14
parentd0c93194ecde2886d4e90d7006c998ea9592d0a0
refs: add option core.logAllRefUpdates = always

When core.logallrefupdates is true, we only create a new reflog for refs
that are under certain well-known hierarchies. The reason is that we
know that some hierarchies (like refs/tags) are not meant to change, and
that unknown hierarchies might not want reflogs at all (e.g., a
hypothetical refs/foo might be meant to change often and drop old
history immediately).

However, sometimes it is useful to override this decision and simply log
for all refs, because the safety and audit trail is more important than
the performance implications of keeping the log around.

This patch introduces a new "always" mode for the core.logallrefupdates
option which will log updates to everything under refs/, regardless
where in the hierarchy it is (we still will not log things like
ORIG_HEAD and FETCH_HEAD, which are known to be transient).

Based-on-patch-by: Jeff King <peff@peff.net>
Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 files changed:
Documentation/config.txt
Documentation/git-tag.txt
branch.c
builtin/checkout.c
builtin/init-db.c
cache.h
config.c
environment.c
refs.c
refs.h
refs/files-backend.c
refs/refs-internal.h
t/t1400-update-ref.sh
t/t7004-tag.sh