summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-20 18:43:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-20 19:40:49 (GMT)
commit49672f26d9a3826a6a74c6ff4d2409b7b0c74495 (patch)
tree455516c784f1797d24873010410b4a5a225788c9 /Documentation
parent8b43fb18f808524297a050e33f33db8569bc1116 (diff)
downloadgit-49672f26d9a3826a6a74c6ff4d2409b7b0c74495.zip
git-49672f26d9a3826a6a74c6ff4d2409b7b0c74495.tar.gz
git-49672f26d9a3826a6a74c6ff4d2409b7b0c74495.tar.bz2
refs: introduce a "ref paranoia" flag
Most operations that iterate over refs are happy to ignore broken cruft. However, some operations should be performed with knowledge of these broken refs, because it is better for the operation to choke on a missing object than it is to silently pretend that the ref did not exist (e.g., if we are computing the set of reachable tips in order to prune objects). These processes could just call for_each_rawref, except that ref iteration is often hidden behind other interfaces. For instance, for a destructive "repack -ad", we would have to inform "pack-objects" that we are destructive, and then it would in turn have to tell the revision code that our "--all" should include broken refs. It's much simpler to just set a global for "dangerous" operations that includes broken refs in all iterations. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/git.txt b/Documentation/git.txt
index af30620..8da85a6 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -1026,6 +1026,17 @@ GIT_ICASE_PATHSPECS::
variable when it is invoked as the top level command by the
end user, to be recorded in the body of the reflog.
+`GIT_REF_PARANOIA`::
+ If set to `1`, include broken or badly named refs when iterating
+ over lists of refs. In a normal, non-corrupted repository, this
+ does nothing. However, enabling it may help git to detect and
+ abort some operations in the presence of broken refs. Git sets
+ this variable automatically when performing destructive
+ operations like linkgit:git-prune[1]. You should not need to set
+ it yourself unless you want to be paranoid about making sure
+ an operation has touched every ref (e.g., because you are
+ cloning a repository to make a backup).
+
Discussion[[Discussion]]
------------------------