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

Re: [PATCH 0/3] pretty: format aliases

From
Jeff King <peff@peff.net>
Date
Apr 26, 2010, 18:07 UTC
Message-ID
<20100426180731.GB4012@coredump.intra.peff.net>
In-Reply-To
<20100426175707.GB11022@progeny.tock>
On Mon, Apr 26, 2010 at 12:57:08PM -0500, Jonathan Nieder wrote:
Show 8 quoted lines
> > To be clear, I don't have any problem with the _functionality_. I just
> > think it probably should have been log.pretty, or pretty.default or
> > something. Too late now, though.
> 
> Ah, sorry to be dense.  Maybe something like the following would work:
> 
>  [log "format"]
> 	changelog = "* [%h] %s"

We usually reserve the [log "format"] for when "format" can be an arbitrary string. I'm not sure if we can use some nicer syntax like [log.format]; I'd have to experiment.

> This is rev-list’s code, and log is its most noticeable manifestation.

We also tend to refer to the log/show/whatchanged as "the log family of commands". I think whatchanged is pretty much dead and historical at this point, though.

Show 12 quoted lines
> By the way: I just noticed today that rev-list is not very friendly
> when given a --pretty=format: specification:
> 
>   $ git rev-list -1 --oneline HEAD
>   651b91e log --format=email: fix confusing variable name
>   $ git rev-list -1 --format='%h %s' HEAD
>   commit 651b91ef7a15a46145d65193c8709670b969161f
>   651b91e log --format=email: fix confusing variable name
> 
> Is this deliberate?  I mention it because I seem to remember from the
> discussion of --decorate configuration that scripts should be using
> rev-list in preference to log even when a --format option is involved.

I'm not sure it's deliberate, as in somebody thought it was a good idea. But it has always been that way, and I think it has been deliberate that we not change it. I agree it is unfriendly.

I think we have accepted that scripts will use log because of its enhanced features (gitk does), but we generally suppress extra output (like decorations or notes) for at least --pretty=raw and --pretty=format.

-Peff
Previous: Jonathan NiederNext: Jonathan Nieder
Message 11 of 16 in “pretty: format aliases”
  1. 0/3 pretty: format aliasesWill Palmer, Apr 25, 2010
  2. 1/3 pretty: add conditional %C?colorname placeholdersWill Palmer, Apr 25, 2010
  3. Alex RiesenApr 26, 2010
  4. 2/3 pretty: make %H/%h dependent on --abbrev[-commit]Will Palmer, Apr 25, 2010
  5. 3/3 pretty: add aliases for pretty formatsWill Palmer, Apr 25, 2010
  6. Jeff KingApr 25, 2010
  7. Will PalmerApr 25, 2010
  8. Jonathan NiederApr 25, 2010
  9. Jeff KingApr 26, 2010
  10. Jonathan NiederApr 26, 2010
  11. Jeff KingApr 26, 2010
  12. Jonathan NiederApr 26, 2010
  13. Will PalmerApr 26, 2010
  14. Jonathan NiederApr 26, 2010
  15. Jeff KingApr 27, 2010
  16. Will PalmerApr 26, 2010

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.