git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: [BUG] 'git show-ref <pattern>' doesn't work (shows nothing)
Date: Mon, 18 Oct 2010 12:03:37 +0200	[thread overview]
Message-ID: <201010181203.38554.jnareb@gmail.com> (raw)

In the git-show-ref documentation we read:

  git-show-ref - List references in a local repository

  SYNOPSIS
  --------
  [verse]
  'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference]
               [-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags]
               [--heads] [--] [<pattern>...]
  'git show-ref' --exclude-existing[=<pattern>] < ref-list

  DESCRIPTION
  -----------

  Displays references available in a local repository along with the
  associated commit IDs. Results can be filtered using a pattern and
  tags can be dereferenced into object IDs. Additionally, it can be
  used to test whether a particular ref exists.

Let's overlook the fact that the using '--verify' is a separate way of 
operation, and should be given seperate line in synopsis.

What is more important is that filtering using pattern doesn't work.  
All of commands listed below produce empty output:

  $ git show-ref refs/heads
  $ git show-ref refs/heads/
  $ git show-ref 'refs/heads/*'
  $ git show-ref -- refs/heads
  $ git show-ref -- 'refs/heads/*'

Note that using '--heads' gives output:

  $ git show-ref --heads
  01cc740941a6b81fd7be03484c83f688dc79a5f2 refs/heads/Git.pm
  23b2a0387f0acd7e3cd906a0dc3c2c23dd32c03d refs/heads/autoconf
  [...]

but I am more interested in patterns like 'refs/heads/gitweb/', or 
'refs/remotes/origin/', or 'refs/tags/v*'.

For the time of being I'd have to use git-for-each-ref instead:

  $ git for-each-ref refs/heads/
  01cc740941a6b81fd7be03484c83f688dc79a5f2 commit refs/heads/Git.pm
  23b2a0387f0acd7e3cd906a0dc3c2c23dd32c03d commit refs/heads/autoconf

(though to get same output I'd have to use appropriate <format>).
-- 
Jakub Narebski
Poland

             reply	other threads:[~2010-10-18 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 10:03 Jakub Narebski [this message]
2010-10-18 11:33 ` [PATCH] git-show-ref.txt: clarify the pattern matching Michael J Gruber
2010-10-18 12:07   ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201010181203.38554.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).