Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn: shorten glob error message
Error messages should attempt to fit within the confines of
an 80-column terminal to avoid compatibility and accessibility
problems.  Furthermore the word "directories" can be misleading
when used in the context of git refnames.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Eric Wong committed Mar 15, 2016
1 parent e4e5dd9 commit 62335bb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions perl/Git/SVN/GlobSpec.pm
Expand Up @@ -8,8 +8,8 @@ sub new {
$re =~ s!/+$!!g; # no need for trailing slashes
my (@left, @right, @patterns);
my $state = "left";
my $die_msg = "Only one set of wildcard directories " .
"(e.g. '*' or '*/*/*') is supported: '$glob'\n";
my $die_msg = "Only one set of wildcards " .
"(e.g. '*' or '*/*/*') is supported: $glob\n";
for my $part (split(m|/|, $glob)) {
if ($pattern_ok && $part =~ /[{}]/ &&
$part !~ /^\{[^{}]+\}/) {
Expand Down
9 changes: 6 additions & 3 deletions t/t9108-git-svn-glob.sh
Expand Up @@ -86,9 +86,12 @@ test_expect_success 'test left-hand-side only globbing' '
test_cmp expect.two output.two
'

echo "Only one set of wildcard directories" \
"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
echo "" >> expect.three
test_expect_success 'prepare test disallow multi-globs' "
cat >expect.three <<EOF
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
EOF
"

test_expect_success 'test disallow multi-globs' '
git config --add svn-remote.three.url "$svnrepo" &&
Expand Down
9 changes: 6 additions & 3 deletions t/t9109-git-svn-multi-glob.sh
Expand Up @@ -135,9 +135,12 @@ test_expect_success 'test another branch' '
test_cmp expect.four output.four
'

echo "Only one set of wildcard directories" \
"(e.g. '*' or '*/*/*') is supported: 'branches/*/t/*'" > expect.three
echo "" >> expect.three
test_expect_success 'prepare test disallow multiple globs' "
cat >expect.three <<EOF
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/*/t/*
EOF
"

test_expect_success 'test disallow multiple globs' '
git config --add svn-remote.three.url "$svnrepo" &&
Expand Down
7 changes: 4 additions & 3 deletions t/t9168-git-svn-partially-globbed-names.sh
Expand Up @@ -130,9 +130,10 @@ test_expect_success 'test prefixed globs match just prefix' '
'

test_expect_success 'prepare test disallow prefixed multi-globs' "
echo \"Only one set of wildcard directories\" \
\"(e.g. '*' or '*/*/*') is supported: 'branches/b_*/t/*'\" >expect.four &&
echo \"\" >>expect.four
cat >expect.four <<EOF
Only one set of wildcards (e.g. '*' or '*/*/*') is supported: branches/b_*/t/*
EOF
"

test_expect_success 'test disallow prefixed multi-globs' '
Expand Down

0 comments on commit 62335bb

Please sign in to comment.