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

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Sep 25, 2012, 15:19 UTC
Message-ID
<vpqvcf2ruyv.fsf@grenoble-inp.fr>
In-Reply-To
<20120925002325.GA19560@sigill.intra.peff.net>
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, while I never know whether
  git log --grep=foo --grep=bar
is a OR or a AND (there was a patch recently to clarify the doc).

Note that Mercurial's version seem to really act on sets of commits, not just individual commits, as it allows things like

  hg log -r 'sort(date("May 2008"), user)'
or the equivalent of git's negative revision argument :
  "x - y"
      Changesets in x but not in y.

So it would be more a new "git log --filter='some expression'", not a --pretty=lua.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Stephen BashNext: Junio C Hamano
Message 13 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.