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

Re: [RFC/PATCH 0/3] git log --pretty=lua

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 25, 2012, 16:40 UTC
Message-ID
<7vhaqmvywo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<vpqvcf2ruyv.fsf@grenoble-inp.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 19 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> We've talked off and on about extending the --pretty=format specifiers
>> to something more flexible. There's also been talk recently of more
>> flexible commit-filtering (e.g., grepping individual notes).
>
> Mercurial has a similar thing, which can be a source of inspiration:
>
> http://www.selenic.com/hg/help/revsets
>
> On the one hand, if find it a bit overkill to have a full language for
> this, but on the other hand, it allows expressing easily and explicitely
> boolean operators.
>
> I would find
>
>   git log 'grep(foo) or grep(bar)'
>
> very intuitive and elegant,...

You have to be careful with "grep", though. It would be unclear what "and" there would mean if you replaced your "or" with.

Peff's earlier examples e.g.
  git log --lua-filter='
    return
      author().name.match("Junio") &&
      note("p4").match("1234567")
  '
  git log --lua-filter='return subject().len > 100'
are clearly good ones that illustrate the power of filtering.
Previous: Matthieu MoyNext: Nguyen Thai Ngoc Duy
Message 14 of 15 in “git log --pretty=lua”
  1. 0/3 git log --pretty=luaJeff King, Sep 25, 2012
  2. 1/3 pretty: make some commit-parsing helpers more publicJeff King, Sep 25, 2012
  3. 2/3 add basic lua infrastructureJeff King, Sep 25, 2012
  4. Nguyen Thai Ngoc DuySep 25, 2012
  5. Jeff KingSep 25, 2012
  6. Robin H. JohnsonSep 25, 2012
  7. Jeff KingSep 25, 2012
  8. Junio C HamanoSep 25, 2012
  9. 3/3 add a "lua" pretty formatJeff King, Sep 25, 2012
  10. Jeff KingOct 6, 2012
  11. Nguyen Thai Ngoc DuySep 25, 2012
  12. Stephen BashSep 25, 2012
  13. Matthieu MoySep 25, 2012
  14. Junio C HamanoSep 25, 2012
  15. Nguyen Thai Ngoc DuySep 30, 2012

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.