• J
    add core.usereplacerefs config option · da4398d6
    Jeff King 提交于
    We can already disable replace refs using a command line
    option or environment variable, but those are awkward to
    apply universally. Let's add a config option to do the same
    thing.
    
    That raises the question of why one might want to do so
    universally. The answer is that replace refs violate the
    immutability of objects. For instance, if you wanted to
    cache the diff between commit XYZ and its parent, then in
    theory that never changes; the hash XYZ represents the total
    state. But replace refs violate that; pushing up a new ref
    may create a completely new diff.
    
    The obvious "if it hurts, don't do it" answer is not to
    create replace refs if you're doing this kind of caching.
    But for a site hosting arbitrary repositories, they may want
    to allow users to share replace refs with each other, but
    not actually respect them on the site (because the caching
    is more important than the replace feature).
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    da4398d6
config.c 77.9 KB