Re: [PATCH 3/3] git-fetch: allow glob pattern in refspec
- From
- Michael Loeffler <miloeffler@googlemail.com>
- Date
- Nov 27, 2006, 18:14 UTC
- Message-ID
- <1164651262.13153.31.camel@ibook.zvpunry.de>
- In-Reply-To
- <7vzmaik4mi.fsf@assigned-by-dhcp.cox.net>
hi,
Am Mittwoch, den 22.11.2006, 23:24 -0800 schrieb Junio C Hamano:
> This adds Andy's refspec glob. You can have a single line: > > Pull: refs/heads/*:refs/remotes/origin/*
How about using extended regex for this, something like this: Pull: refs/heads/master:refs/remotes/origin/master Pull: refs/tags/v(.*):refs/tags/origin/v\1
...
> +expand_refs_wildcard () {
> + for ref
> + do... How about using something like: echo "$ls_remote_result" | sed -n -r -e "s:$ref: p"
Using $ref as a part of the sed expression is not a good idea (.* should not match past the ':'), but something like this maybe. What do you think?
bye