Re: [PATCH] filter-branch: when dwim'ing a ref, only allow heads andtags
- From
Johannes Sixt <j.sixt@eudaptics.com>
- Date
- Jul 24, 2007, 11:04 UTC
- Message-ID
- <46A5DCBC.E585A69D@eudaptics.com>
- In-Reply-To
- <Pine.LNX.4.64.0707241134330.14781@racer.site>
Johannes Schindelin wrote:
> - grep /"$ref")" > + grep "refs/\(tags\|heads\)/$ref$")"
Thanks, but I don't think that this is a portable grep pattern:
$ echo "abc" | grep '\(a\|x\)' $ echo "abc" | egrep '(a|x)' abc
But then, this is on some AIX 4.3. How about:
fgrep -e "refs/heads/$ref" -e "refs/tags/$ref" or grep -e "^refs/heads/$ref" -e "^refs/tags/$ref"
-- Hannes