Skip to content
  • Duy Nguyen's avatar
    tree-walk: support :(attr) matching · 5a0b97b3
    Duy Nguyen authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    This lets us use :(attr) with "git grep <tree-ish>" or "git log".
    
    :(attr) requires another round of checking before we can declare that
    a path is matched. This is done after path matching since we have lots
    of optimization to take a shortcut when things don't match.
    
    Note that if :(attr) is present, we can't return
    all_entries_interesting / all_entries_not_interesting anymore because
    we can't be certain about that. Not until match_pathspec_attrs() can
    tell us "yes all these paths satisfy :(attr)".
    
    Second note. Even though we walk a specific tree, we use attributes
    from _worktree_ (or falling back to the index), not from .gitattributes
    files on that tree. This by itself is not necessarily wrong, but the
    user just have to be aware of this.
    
    Signed-off-by: default avatarNguyễn Thái Ngọc Duy <pclouds@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    5a0b97b3