Skip to content
  • Jacob Keller's avatar
    name-rev: add support to exclude refs by pattern match · 96415b49
    Jacob Keller authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Extend git-name-rev to support excluding refs which match shell patterns
    using --exclude. These patterns can be used to limit the scope of refs
    by excluding any ref that matches one of the --exclude patterns. A ref
    will only be used for naming when it matches at least one --refs pattern
    but does not match any of the --exclude patterns. Thus, --exclude
    patterns are given precedence over --refs patterns.
    
    For example, suppose you wish to name a series of commits based on an
    official release tag of the form "v*" but excluding any pre-release tags
    which match "*rc*". You can use the following to do so:
    
      git name-rev --refs="v*" --exclude="*rc*" --all
    
    Add tests and update Documentation for this change.
    
    Signed-off-by: default avatarJacob Keller <jacob.keller@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    96415b49