git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] rev-list/log: document logic with several limiting options
Date: Thu, 13 Sep 2012 09:28:19 +0200	[thread overview]
Message-ID: <50518B13.5010702@drmicha.warpmail.net> (raw)
In-Reply-To: <7vbohbdufz.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 12.09.2012 19:25:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> It was introduced in 0ab7befa with a clear meaning (AND everything),
>> then the general logic (without --all-match) was modified in 80235ba7
>> (to take headermatch AND (all greps ORed)), and 5aaeb733 finally made
>> multiple authors resp. committers get ORed among each other. All of this
>> in an attempt to make the standard usage most useful, of course. As a
>> consequence, --all-match does not influence multiple --author options at
>> all (contrary to the doc), e.g.
>>
>> I don't see any of this reflected in the doc, though. I noticed only by
>> reading t/t7810-grep.sh. Before that, I had only gone by my own testing
>> which didn't reveal the multiple author multiple special casing effect.
>>
>> I guess I'll have to wrap my head around the current implementation a
>> few more times before trying to describe the status quo in the
>> documentation...
> 
> This is what I used to use when adding these generalized grep
> boolean expressions.
> 
> With this applied, you can try things like these:
> 
>     $ git log --grep=regexp --grep=nosuch --all-match >/dev/null
>     $ git log --grep=regexp --grep=nosuch --author=Michael >/dev/null
> 
> For example, "--all-match --grep=regexp --author=Michael --author=Linus" turns
> into
> 
>     [all-match]
>     (or
>      pattern_body<body>regexp
>      (or
>       (or
>        pattern_head<head 0>Linus
>        pattern_head<head 0>Michael
>       )
>       true
>      )
>     )
> 
> that says "body must have 'regexp' in it, and authored by either
> Linus or Michael".
> 
> The semantics of "--all-match" is different from "--and" (which,
> together with "--or", ")", and "(", is not availble to rev-list
> command line parser primarily because "--not" is not available).
> After applying all the "or"-ed terms, it checks the top-level nodes
> that are "or"-ed and makes sure all of them fired (possibly and
> usually on different lines).

Thanks for "this" ;)

I'll recheck my understanding and update the doc then. Maybe even
putting the above in-tree with a "--debug" option seems inline with
things such as "git describe --debug" (and maybe a preparation for
exposing a richer interface).

Michael

  parent reply	other threads:[~2012-09-13  7:28 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 14:45 [PATCH] rev-list/log: document logic with several limiting options Michael J Gruber
2012-09-11 16:22 ` Junio C Hamano
2012-09-12 13:43   ` Michael J Gruber
2012-09-12 17:25     ` Junio C Hamano
2012-09-12 17:26       ` Junio C Hamano
2012-09-13 14:04         ` [PATCHv2 0/6] " Michael J Gruber
2012-09-13 14:04           ` [PATCHv2 1/6] t7810-grep: bring log --grep tests in common form Michael J Gruber
2012-09-13 14:04           ` [PATCHv2 2/6] t7810-grep: test multiple --grep with and without --all-match Michael J Gruber
2012-09-13 14:04           ` [PATCHv2 3/6] t7810-grep: test multiple --author with --all-match Michael J Gruber
2012-09-13 20:47             ` Junio C Hamano
2012-09-13 23:26               ` Junio C Hamano
2012-09-14  8:14                 ` Michael J Gruber
2012-09-14 15:55                   ` Junio C Hamano
2012-09-13 14:04           ` [PATCHv2 4/6] t7810-grep: test interaction of multiple --grep and --author options Michael J Gruber
2012-09-13 14:04           ` [PATCHv2 5/6] t7810-grep: test --all-match with " Michael J Gruber
2012-09-13 14:04           ` [PATCHv2 6/6] rev-list/log: document logic with several limiting options Michael J Gruber
2012-09-13 22:29             ` Junio C Hamano
2012-09-14  1:19               ` Junio C Hamano
2012-09-14  2:04                 ` Junio C Hamano
2012-09-14  9:46                   ` [PATCHv3 00/11] " Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 01/11] grep: teach --debug option to dump the parse tree Michael J Gruber
2012-09-14 17:09                       ` Junio C Hamano
2012-09-14  9:46                     ` [PATCHv3 02/11] log: name --debug-grep option like in the commit message Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 03/11] grep: show --debug output only once Michael J Gruber
2012-09-14 17:11                       ` Junio C Hamano
2012-09-14  9:46                     ` [PATCHv3 04/11] log --grep/--author: honor --all-match honored for multiple --grep patterns Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 05/11] log: document use of multiple commit limiting options Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 06/11] fixup! " Michael J Gruber
2012-09-14 17:23                       ` Junio C Hamano
2012-09-14  9:46                     ` [PATCHv3 07/11] t7810-grep: bring log --grep tests in common form Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 08/11] t7810-grep: test multiple --grep with and without --all-match Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 09/11] t7810-grep: test multiple --author with --all-match Michael J Gruber
2012-09-14 17:58                       ` Junio C Hamano
2012-09-14  9:46                     ` [PATCHv3 10/11] t7810-grep: test interaction of multiple --grep and --author options Michael J Gruber
2012-09-14  9:46                     ` [PATCHv3 11/11] t7810-grep: test --all-match with " Michael J Gruber
2012-09-14 18:01                       ` Junio C Hamano
2012-09-14 17:25                     ` [PATCHv3 00/11] rev-list/log: document logic with several limiting options Junio C Hamano
2012-09-13 20:18           ` [PATCHv2 0/6] " Junio C Hamano
2012-09-13  7:28       ` Michael J Gruber [this message]
2012-09-13 21:21         ` [PATCH] " Junio C Hamano
2012-09-14  7:46           ` Michael J Gruber
2012-09-14  7:50             ` Junio C Hamano
2012-09-14  8:21               ` Michael J Gruber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50518B13.5010702@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).