From: Junio C Hamano Date: Mon, 1 Feb 2016 23:14:24 +0000 (-0800) Subject: Merge branch 'jk/list-tag-2.7-regression' X-Git-Tag: v2.8.0-rc0~87 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8bad3de2c8390d952308652493fb72f58820895e?ds=inline;hp=-c Merge branch 'jk/list-tag-2.7-regression' "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 --- 8bad3de2c8390d952308652493fb72f58820895e diff --combined Documentation/git-for-each-ref.txt index 06208c4990,d5e1781db7..2e3e96f663 --- a/Documentation/git-for-each-ref.txt +++ b/Documentation/git-for-each-ref.txt @@@ -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=` is appended, strips `` + slash-separated path components from the front of the refname + (e.g., `%(refname:strip=2)` turns `refs/tags/foo` into `foo`. + `` must be a positive integer. If a displayed ref has fewer + components than ``, 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 2797f22530,c64579fe15..cf3469b142 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@@ -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