From: SZEDER Gábor Date: Fri, 12 Feb 2016 23:43:00 GMT Subject: Re: [PATCH] git-completion.bash: always swallow error output of for-each-ref Message-ID: <20160213004300.Horde.fMBUV1thpmh_xekWw-EOFAA@webmail.informatik.kit.edu> In-Reply-To: <20160213002122.Horde.mxoPmZIuCikpV2PO97l11AI@webmail.informatik.kit.edu> Quoting SZEDER Gábor : > Now, if 'git for-each-ref' could understand '**' globbing, not just > fnmatch... Oh, look, though the manpage says: ... If one or more patterns are given, only refs are shown that match against at least one pattern, either using fnmatch(3) or literally, 'git for-each-ref' does in fact understand double asterisks: $ git for-each-ref --format='%(refname)' '**/master' refs/heads/master refs/remotes/github/master refs/remotes/origin/master $ git for-each-ref --format='%(refname)' 'refs/heads/b/**' refs/heads/b/r/a/n/c/h Great, this combined with refname:strip=2 and 3 might open up some more optimization possibilities...