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/