Skip to content
  • Björn Steinbrink's avatar
    git-describe: Die early if there are no possible descriptions · d68dc34c
    Björn Steinbrink authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    If we find no refs that may be used for git-describe with the current
    options, then die early instead of pointlessly walking the whole
    history.
    
    In git.git with all the tags dropped, this makes "git describe" go down
    from 0.244 to 0.003 seconds for me. This is especially noticeable with
    "git submodule status" which calls describe with increasing levels of
    allowed refs to be matched. For a submodule without tags, this means
    that it walks the whole history in the submodule twice (first annotated,
    then plain tags), just to find out that it can't describe the commit
    anyway.
    
    Signed-off-by: default avatarBjörn Steinbrink <B.Steinbrink@gmx.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    d68dc34c