Re: [PATCH] git-svn: loosen config globs limitations
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Jan 13, 2016, 03:16 UTC
- Message-ID
- <20160113031601.GA28224@dcvr.yhbt.net>
- In-Reply-To
- <1452522358-16943-1-git-send-email-vleschuk@accesssoftek.com>
Thanks, I made a minor cleanup and applied with --whitespace=fix to remove spaces from indentation.
--- a/perl/Git/SVN/GlobSpec.pm +++ b/perl/Git/SVN/GlobSpec.pm @@ -15,8 +15,10 @@ sub new { $part !~ /^\{[^{}]+\}/) { die "Invalid pattern in '$glob': $part\n"; } - my $nstars = $part =~ tr/\*//; - die "Only one '*' is allowed in a pattern: '$part'\n" if $nstars > 1; + my $nstars = $part =~ tr/*//; + if ($nstars > 1) { + die "Only one '*' is allowed in a pattern: '$part'\n"; + } if ($part =~ /(.*)\*(.*)/) { die $die_msg if $state eq "right"; my ($l, $r) = ($1, $2); So I'll push out with the following commit message: Subject: [PATCH] git-svn: loosen config globs limitations Expand the area of globs applicability for branches and tags in git-svn. It is now possible to use globs like 'a*e', or 'release_*'. This allows users to avoid long lines in config like: branches = branches/{release_20,release_21,release_22,...} In favor of: branches = branches/release_* [ew: amended commit message, minor formatting and style fixes] Signed-off-by: Victor Leschuk <vleschuk@accesssoftek.com> Signed-off-by: Eric Wong <normalperson@yhbt.net> I also noticed the "Only one set of wildcard directories" error message is unnecessary long and "wildcard directories" should probably be shortened to "wildcards" to avoid wrapping in a terminal. That will probably be a separate patch for me.