# git branch: filtering by formatted ref when using --format and --list flags

1 messages from 2021-03-10 to 2021-03-10. Participants: Aaron Lipman.
Thread: https://gitlist.dev/t/55283

## Aaron Lipman, 2021-03-10 13:36

Subject: git branch: filtering by formatted ref when using --format and --list flags
Message-ID: <CAEJZ43juPmz2z+J45hJCBzCAG6seG4qbvPh3we4f3iexeU5r+Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAEJZ43juPmz2z%2BJ45hJCBzCAG6seG4qbvPh3we4f3iexeU5r%2BQ%40mail.gmail.com

```
A few days ago, I wanted to list my branches on a remote. (By "my
branches", I mean branches whose head commit I authored.) The first
command I tried was:

git branch -r --format '%(refname:short) %(authoremail)' \
              --list '*aaron@example.com*'

However, the --list flag only applies filtering using plain refname,
not custom-formatted refs. So I just used grep:

git branch -r --format '%(refname:short) %(authoremail)' |
  grep 'aaron@example.com'

Even though grep works fine, I'd find it convenient for git branch/tag
to filter formatted refs when passed both --format and --list flags. I
have a patch series implementing this, but before I polish my work to
get it submission ready, I wanted to check whether others feel this is
a worthwhile change. Feedback welcome.

```
