git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Aaron Lipman <alipman88@gmail.com>
Date
Mar 10, 2021, 13:36 UTC
Message-ID
<CAEJZ43juPmz2z+J45hJCBzCAG6seG4qbvPh3we4f3iexeU5r+Q@mail.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.

Message 1 of 1 in “git branch: filtering by formatted ref when using --format and --list flags”
  1. Aaron LipmanMar 10, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.