Merge branch 'jk/list-tag-2.7-regression'
authorJunio C Hamano <gitster@pobox.com>
Mon, 1 Feb 2016 23:14:24 +0000 (15:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Feb 2016 23:14:24 +0000 (15:14 -0800)
"git tag" started listing a tag "foo" as "tags/foo" when a branch
named "foo" exists in the same repository; remove this unnecessary
disambiguation, which is a regression introduced in v2.7.0.

* jk/list-tag-2.7-regression:
tag: do not show ambiguous tag names as "tags/foo"
t6300: use test_atom for some un-modern tests

1  2 
Documentation/git-for-each-ref.txt
t/t7004-tag.sh
index 06208c49901c6c7e73aa6b6d593e533f7cf57dc5,d5e1781db71a8a993fc282034138ba16f77aaf48..2e3e96f663e2ffa678f7242a661cf1f68f9c5d77
@@@ -92,7 -92,11 +92,11 @@@ refname:
        The name of the ref (the part after $GIT_DIR/).
        For a non-ambiguous short name of the ref append `:short`.
        The option core.warnAmbiguousRefs is used to select the strict
-       abbreviation mode.
+       abbreviation mode. If `strip=<N>` is appended, strips `<N>`
+       slash-separated path components from the front of the refname
+       (e.g., `%(refname:strip=2)` turns `refs/tags/foo` into `foo`.
+       `<N>` must be a positive integer.  If a displayed ref has fewer
+       components than `<N>`, the command aborts with an error.
  
  objecttype::
        The type of the object (`blob`, `tree`, `commit`, `tag`).
@@@ -142,11 -146,6 +146,11 @@@ In addition to the above, for commit an
  field names (`tree`, `parent`, `object`, `type`, and `tag`) can
  be used to specify the value in the header field.
  
 +For commit and tag objects, the special `creatordate` and `creator`
 +fields will correspond to the appropriate date or name-email-date tuple
 +from the `committer` or `tagger` fields depending on the object type.
 +These are intended for working on a mix of annotated and lightweight tags.
 +
  Fields that have name-email-date tuple as its value (`author`,
  `committer`, and `tagger`) can be suffixed with `name`, `email`,
  and `date` to extract the named component.
@@@ -158,8 -157,8 +162,8 @@@ line is 'contents:body', where body is 
  blank line.  The optional GPG signature is `contents:signature`.  The
  first `N` lines of the message is obtained using `contents:lines=N`.
  
 -For sorting purposes, fields with numeric values sort in numeric
 -order (`objectsize`, `authordate`, `committerdate`, `taggerdate`).
 +For sorting purposes, fields with numeric values sort in numeric order
 +(`objectsize`, `authordate`, `committerdate`, `creatordate`, `taggerdate`).
  All other fields are used to sort in their byte-value order.
  
  There is also an option to sort by versions, this can be done by using
diff --combined t/t7004-tag.sh
index 2797f225308fa28965bc06017a4c0b772ab97025,c64579fe152bac31e5b2d1acf8179248be6f6e89..cf3469b142d7ab015dca14f4f9898bae784a9e9a
@@@ -23,8 -23,8 +23,8 @@@ test_expect_success 'listing all tags i
  '
  
  test_expect_success 'listing all tags in an empty tree should output nothing' '
 -      test `git tag -l | wc -l` -eq 0 &&
 -      test `git tag | wc -l` -eq 0
 +      test $(git tag -l | wc -l) -eq 0 &&
 +      test $(git tag | wc -l) -eq 0
  '
  
  test_expect_success 'looking for a tag in an empty tree should fail' \
@@@ -72,8 -72,8 +72,8 @@@ test_expect_success 'listing all tags i
  '
  
  test_expect_success 'listing all tags if one exists should output that tag' '
 -      test `git tag -l` = mytag &&
 -      test `git tag` = mytag
 +      test $(git tag -l) = mytag &&
 +      test $(git tag) = mytag
  '
  
  # pattern matching:
@@@ -83,7 -83,7 +83,7 @@@ test_expect_success 'listing a tag usin
  
  test_expect_success \
        'listing a tag using a matching pattern should output that tag' \
 -      'test `git tag -l mytag` = mytag'
 +      'test $(git tag -l mytag) = mytag'
  
  # todo: git tag -l now returns always zero, when fixed, change this test
  test_expect_success \
@@@ -92,7 -92,7 +92,7 @@@
  
  test_expect_success \
        'listing tags using a non-matching pattern should output nothing' \
 -      'test `git tag -l xxx | wc -l` -eq 0'
 +      'test $(git tag -l xxx | wc -l) -eq 0'
  
  # special cases for creating tags:
  
@@@ -102,13 -102,13 +102,13 @@@ test_expect_success 
  
  test_expect_success \
        'trying to create a tag with a non-valid name should fail' '
 -      test `git tag -l | wc -l` -eq 1 &&
 +      test $(git tag -l | wc -l) -eq 1 &&
        test_must_fail git tag "" &&
        test_must_fail git tag .othertag &&
        test_must_fail git tag "other tag" &&
        test_must_fail git tag "othertag^" &&
        test_must_fail git tag "other~tag" &&
 -      test `git tag -l | wc -l` -eq 1
 +      test $(git tag -l | wc -l) -eq 1
  '
  
  test_expect_success 'creating a tag using HEAD directly should succeed' '
@@@ -1558,4 -1558,12 +1558,12 @@@ test_expect_success '--no-merged show u
        test_cmp expect actual
  '
  
+ test_expect_success 'ambiguous branch/tags not marked' '
+       git tag ambiguous &&
+       git branch ambiguous &&
+       echo ambiguous >expect &&
+       git tag -l ambiguous >actual &&
+       test_cmp expect actual
+ '
  test_done