[PATCH 0/5] Extend pattern refspecs
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Mar 6, 2009, 04:56 UTC
- Message-ID
- <alpine.LNX.1.00.0903052346270.19665@iabervon.org>
This series only supports the narrowest case of having the * in the middle of a side of a refspec: having it as a full path component on each side.
Patches 1-3 centralize all of the parsing and matching rules to a pair of functions; patch 4 makes the stored representation more convenient (and serves as a distinguished bisection outcome for anything I missed that was relying on the contents of struct refspec for patterns); and patch 5 extends the matching implementation and loosens the ref format requirements to allow the * to be in the middle.
An easy followup would relax the restrictions further without requiring any particularly tricky further changes.
Daniel Barkalow (5): Make clone parse the default fetch refspec with the regular code Use a single function to match names against patterns Use the matching function to generate the match results Keep '*' in pattern refspecs Support '*' in the middle of a refspec
builtin-clone.c | 25 ++++++++-------- refs.c | 15 +++++---- remote.c | 78 +++++++++++++++++++++++++++++---------------------- t/t5511-refspec.sh | 12 ++++++++ 4 files changed, 77 insertions(+), 53 deletions(-)