summaryrefslogtreecommitdiff
path: root/t/t7004-tag.sh
diff options
context:
space:
mode:
authorCarlos Rica <jasampler@gmail.com>2007-09-01 05:10:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-09-01 06:24:16 (GMT)
commit18e32b5b7af4175f852469159d004a2a8de64658 (patch)
treef437a90154bbd8948d80a0012dcb356b51571394 /t/t7004-tag.sh
parent751eb39590a1325e761a84bedd5ca2660d2d3497 (diff)
downloadgit-18e32b5b7af4175f852469159d004a2a8de64658.zip
git-18e32b5b7af4175f852469159d004a2a8de64658.tar.gz
git-18e32b5b7af4175f852469159d004a2a8de64658.tar.bz2
git-tag: Fix -l option to use better shell style globs.
This patch removes certain behaviour of "git tag -l foo", currently listing every tag name having "foo" as a substring. The same thing now could be achieved doing "git tag -l '*foo*'". This feature was added recently when git-tag.sh got the -n option for showing tag annotations, because that commit also replaced the old "grep pattern" behaviour with a more preferable "shell pattern" behaviour (although slightly modified as you can see). Thus, the following builtin-tag.c implemented it in order to ensure that tests were passing unchanged with both programs. Since common "shell patterns" match names with a given substring _only_ when * is inserted before and after (as in "*substring*"), and the "plain" behaviour cannot be achieved easily with the current implementation, this is mostly the right thing to do, in order to make it more flexible and consistent. Tests for "git tag" were also changed to reflect this. Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7004-tag.sh')
-rwxr-xr-xt/t7004-tag.sh20
1 files changed, 9 insertions, 11 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index c4fa446..606d4f2 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -185,18 +185,17 @@ cba
EOF
test_expect_success \
'listing tags with substring as pattern must print those matching' '
- git-tag -l a > actual &&
+ git-tag -l "*a*" > actual &&
git diff expect actual
'
cat >expect <<EOF
v0.2.1
v1.0.1
-v1.1.3
EOF
test_expect_success \
- 'listing tags with substring as pattern must print those matching' '
- git-tag -l .1 > actual &&
+ 'listing tags with a suffix as pattern must print those matching' '
+ git-tag -l "*.1" > actual &&
git diff expect actual
'
@@ -205,37 +204,36 @@ t210
t211
EOF
test_expect_success \
- 'listing tags with substring as pattern must print those matching' '
- git-tag -l t21 > actual &&
+ 'listing tags with a prefix as pattern must print those matching' '
+ git-tag -l "t21*" > actual &&
git diff expect actual
'
cat >expect <<EOF
a1
-aa1
EOF
test_expect_success \
- 'listing tags using a name as pattern must print those matching' '
+ 'listing tags using a name as pattern must print that one matching' '
git-tag -l a1 > actual &&
git diff expect actual
'
cat >expect <<EOF
v1.0
-v1.0.1
EOF
test_expect_success \
- 'listing tags using a name as pattern must print those matching' '
+ 'listing tags using a name as pattern must print that one matching' '
git-tag -l v1.0 > actual &&
git diff expect actual
'
cat >expect <<EOF
+v1.0.1
v1.1.3
EOF
test_expect_success \
'listing tags with ? in the pattern should print those matching' '
- git-tag -l "1.1?" > actual &&
+ git-tag -l "v1.?.?" > actual &&
git diff expect actual
'