{"thread":{"id":"25467","subject":"[BUG] 'git show-ref <pattern>' doesn't work (shows nothing)","startedAt":"2010-10-18T10:03:37Z","lastAt":"2010-10-18T12:07:29Z","messageCount":3,"participants":["Jakub Narebski","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"153707","messageId":"201010181203.38554.jnareb@gmail.com","threadId":"25467","inReplyTo":null,"subject":"[BUG] 'git show-ref <pattern>' doesn't work (shows nothing)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-18T10:03:37Z","receivedAt":"2010-10-18T10:03:37Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"In the git-show-ref documentation we read:\n\n  git-show-ref - List references in a local repository\n\n  SYNOPSIS\n  --------\n  [verse]\n  'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference]\n               [-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags]\n               [--heads] [--] [<pattern>...]\n  'git show-ref' --exclude-existing[=<pattern>] < ref-list\n\n  DESCRIPTION\n  -----------\n\n  Displays references available in a local repository along with the\n  associated commit IDs. Results can be filtered using a pattern and\n  tags can be dereferenced into object IDs. Additionally, it can be\n  used to test whether a particular ref exists.\n\nLet's overlook the fact that the using '--verify' is a separate way of \noperation, and should be given seperate line in synopsis.\n\nWhat is more important is that filtering using pattern doesn't work.  \nAll of commands listed below produce empty output:\n\n  $ git show-ref refs/heads\n  $ git show-ref refs/heads/\n  $ git show-ref 'refs/heads/*'\n  $ git show-ref -- refs/heads\n  $ git show-ref -- 'refs/heads/*'\n\nNote that using '--heads' gives output:\n\n  $ git show-ref --heads\n  01cc740941a6b81fd7be03484c83f688dc79a5f2 refs/heads/Git.pm\n  23b2a0387f0acd7e3cd906a0dc3c2c23dd32c03d refs/heads/autoconf\n  [...]\n\nbut I am more interested in patterns like 'refs/heads/gitweb/', or \n'refs/remotes/origin/', or 'refs/tags/v*'.\n\nFor the time of being I'd have to use git-for-each-ref instead:\n\n  $ git for-each-ref refs/heads/\n  01cc740941a6b81fd7be03484c83f688dc79a5f2 commit refs/heads/Git.pm\n  23b2a0387f0acd7e3cd906a0dc3c2c23dd32c03d commit refs/heads/autoconf\n\n(though to get same output I'd have to use appropriate <format>).\n-- \nJakub Narebski\nPoland\n"},{"id":"153712","messageId":"21215c6fd41bd344c4226f410b69680f3901549b.1287401559.git.git@drmicha.warpmail.net","threadId":"25467","inReplyTo":"201010181203.38554.jnareb@gmail.com","subject":"[PATCH] git-show-ref.txt: clarify the pattern matching","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-10-18T11:33:32Z","receivedAt":"2010-10-18T11:33:32Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git-show-ref really does not do what one would expect under the name\npattern matching, so describe it.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\n Documentation/git-show-ref.txt |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt\nindex 4696af7..be0ec18 100644\n--- a/Documentation/git-show-ref.txt\n+++ b/Documentation/git-show-ref.txt\n@@ -84,7 +84,11 @@ OPTIONS\n \n <pattern>...::\n \n-\tShow references matching one or more patterns.\n+\tShow references matching one or more patterns. Patterns are matched from\n+\tthe end of the full name, and only complete parts are matched, e.g.\n+\t'master' matches 'refs/heads/master', 'refs/remotes/origin/master',\n+\t'refs/tags/jedi/master' but not 'refs/heads/mymaster' nor\n+\t'refs/remotes/master/jedi'.\n \n OUTPUT\n ------\n-- \n1.7.3.1.208.g53ea2\n"},{"id":"153714","messageId":"201010181407.30770.jnareb@gmail.com","threadId":"25467","inReplyTo":"21215c6fd41bd344c4226f410b69680f3901549b.1287401559.git.git@drmicha.warpmail.net","subject":"Re: [PATCH] git-show-ref.txt: clarify the pattern matching","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-10-18T12:07:29Z","receivedAt":"2010-10-18T12:07:29Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Michael J Gruber wrote:\n\n> git-show-ref really does not do what one would expect under the name\n> pattern matching, so describe it.\n> \n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n\nThanks a lot!  That clarifies it.\n\n-- \nJakub Narebski\nPoland\n"}]}