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

something like git-for-each-ref's --format for commits?

From
Brian Swetland <swetland@google.com>
Date
Jan 6, 2008, 08:52 UTC
Message-ID
<20080106085221.GA1729@bulgaria.corp.google.com>

I'm trying to obtain various information about commits from a script. The --format option to git-for-each-ref would be perfect, except that it only operates on refs, not arbitrary commit objects.

The --pretty=format:... option for git-log, etc has the annoying property of giving you <unknown> instead of an empty string if an item isn't example (say if you use %b on a commit with no body).

Am I missing some obvious solution here?  
Thanks,
Brian
Next: Jeff King
Message 1 of 2 in “something like git-for-each-ref's --format for commits?”
  1. Brian SwetlandJan 6, 2008
  2. Jeff KingJan 6, 2008

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.