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

Re: [PATCH] Add --format that is a synonym to --pretty

From
Jeff King <peff@peff.net>
Date
Feb 24, 2009, 04:50 UTC
Message-ID
<20090224045041.GA4615@coredump.intra.peff.net>
In-Reply-To
<20090224130626.6117@nanako3.lavabit.com>
On Tue, Feb 24, 2009 at 01:06:26PM +0900, Nanako Shiraishi wrote:
> Some people prefer to call the pretty-print styles "format", and get
> annoyed to see "git log --format=short" fail.  Introduce it as a synonym
> to --pretty so that both can be used interchangeably without breaking
> examples in existing web pages or ppeople's expectations.

Thinking about this in context of the proposal to support --oneline (et al), I think this part by itself gives confusing behavior. That is, --pretty=oneline can be shortened to --oneline, but --pretty=format:$x cannot be shortened to --format=$x.

But that is modified by what happens next:
> Having to say --format="format:%h %s" is redundant because none of the
> predefined pretty-print styles have per-cent sign in it, so this patch
> also makes it possible to say --pretty="%h %s" (and --format="%h %s").

This implies that --format=$x is equivalent to --pretty=format:$x, but the patch actually implements the equivalent of --pretty=tformat:$x.

So that raises two concerns:
  1. We have to pick one as the "most common" for this shorthand; are we
     sure tformat is it? (Personally, I think it is, but I think it is a
     subtle point which we should be sure of).
  2. This _almost_ fixes the point I raised above. That is, --format=$x
     would match its longer --pretty=format:$x counterpart. Except that
     --format does _tformat_, which I would have expected to get via
     --tformat under such a proposal.
-Peff
Previous: Nanako ShiraishiNext: Junio C Hamano
Message 17 of 23 in “revision.c: add --format option for 'git log'”
  1. revision.c: add --format option for 'git log'Felipe Contreras, Feb 21, 2009
  2. Junio C HamanoFeb 22, 2009
  3. Felipe ContrerasFeb 22, 2009
  4. Junio C HamanoFeb 22, 2009
  5. Junio C HamanoFeb 22, 2009
  6. Felipe ContrerasFeb 22, 2009
  7. Junio C HamanoFeb 22, 2009
  8. Felipe ContrerasFeb 22, 2009
  9. Junio C HamanoFeb 23, 2009
  10. Felipe ContrerasFeb 24, 2009
  11. Felipe ContrerasFeb 24, 2009
  12. Junio C HamanoFeb 24, 2009
  13. Nanako ShiraishiFeb 24, 2009
  14. Junio C HamanoFeb 24, 2009
  15. Felipe ContrerasFeb 24, 2009
  16. Add --format that is a synonym to --prettyNanako Shiraishi, Feb 24, 2009
  17. Jeff KingFeb 24, 2009
  18. Junio C HamanoFeb 24, 2009
  19. Jeff KingFeb 24, 2009
  20. Felipe ContrerasFeb 24, 2009
  21. Linus TorvaldsFeb 22, 2009
  22. Jakub NarebskiFeb 22, 2009
  23. Wincent ColaiutaFeb 23, 2009

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.