Re: [PATCH 2/2] log --author: take union of multiple "author" requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emil Sit <sit@xxxxxxxxxxx> writes:

> I'm a little confused about the implementation with regards to
> --all-match; does there still need to be an all-match flag?

When used in the context of "git log --grep/--author/--committer" (as
opposed to more flexible "git grep"), in conjunction with either of the
"header match" element (--author/committer), all-match is implied.

The implementation of the all-match rewriting gets a bit trickier than
necessary, as our internal representation of nodes does not have n-ary
ALL-MATCH (nor n-ary OR/AND) node.

An (ALL-MATCH 1 2 3 4) node is instead represented by this grep_expr
binary tree (rooted at the leftmost OR node):

      OR--OR--OR--4
      |   |   |
      1   2   3

and requiring the top-level terms of backbone OR chain (i.e. 1 2 3 4) to
all match.

In order to represent

    (ALL-MATCH
     (PATTERN this)
     (OR (AUTHOR A) (AUTHOR B)))

we cannot simply do

     OR--------------OR-----------author B
     |               |
     pattern "this"  author A

because this requires both (AUTHOR A) and (AUTHOR B) to match, in addition
to "this".  We instead need to do something like:


     OR--------------OR---TRUE
     |               |
     pattern "this"  OR---author B
                     |
                     author A

to say "this" must match and (OR (author A) (author B)) must match (IOW
the terms on the backbone OR chain are (PATTERN this), (OR (AUTHOR A/B))
and TRUE and they all have to match).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]