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

Re: [PATCH] rev-list/log: document logic with several limiting options

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 12, 2012, 13:43 UTC
Message-ID
<50509171.9060604@drmicha.warpmail.net>
In-Reply-To
<7vsjaoil6d.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 11.09.2012 18:22:
Show 11 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> The current behavior is probably as useful as it is confusing. In any
>> case it is going to stay. So, document it.
>>
>> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
>> ---
>> I would have written a test but don't really know where to stick it in.
>> rev-list has many small tests where it doesn't fit.
> 
> "git log" would be the more natural place, I would say.

Well, to me, "git log" is the ui to "git rev-list", so everything which tests the revision walker should be tested using "git rev-list". But I don't care as long as it fits in - and can be found later.

That being said, I now see lots of "log --grep" and "log --author" tests in the grep-test. So I guess there it fits best (despite the misnomer).

Show 16 quoted lines
>>
>>  Documentation/rev-list-options.txt | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
>> index 5436eba..9c13df3 100644
>> --- a/Documentation/rev-list-options.txt
>> +++ b/Documentation/rev-list-options.txt
>> @@ -6,6 +6,12 @@ special notations explained in the description, additional commit
>>  limiting may be applied. Note that they are applied before commit
>>  ordering and formatting options, such as '--reverse'.
>>  
>> +All occurrences of the same option are ORed: '--grep=foo --grep=bar'
>> +limits to commits which match at least one of these conditions.
> 
> How would this interact with "--all-match"?
Badly.

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...

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 43 in “rev-list/log: document logic with several limiting options”
  1. rev-list/log: document logic with several limiting optionsMichael J Gruber, Sep 11, 2012
  2. Junio C HamanoSep 11, 2012
  3. Michael J GruberSep 12, 2012
  4. Junio C HamanoSep 12, 2012
  5. Junio C HamanoSep 12, 2012
  6. 0/6 rev-list/log: document logic with several limiting optionsMichael J Gruber, Sep 13, 2012
  7. Junio C HamanoSep 13, 2012
  8. 1/6 t7810-grep: bring log --grep tests in common formMichael J Gruber, Sep 13, 2012
  9. 2/6 t7810-grep: test multiple --grep with and without --all-matchMichael J Gruber, Sep 13, 2012
  10. 3/6 t7810-grep: test multiple --author with --all-matchMichael J Gruber, Sep 13, 2012
  11. Junio C HamanoSep 13, 2012
  12. Junio C HamanoSep 13, 2012
  13. Michael J GruberSep 14, 2012
  14. Junio C HamanoSep 14, 2012
  15. 4/6 t7810-grep: test interaction of multiple --grep and --author optionsMichael J Gruber, Sep 13, 2012
  16. 5/6 t7810-grep: test --all-match with multiple --grep and --author optionsMichael J Gruber, Sep 13, 2012
  17. 6/6 rev-list/log: document logic with several limiting optionsMichael J Gruber, Sep 13, 2012
  18. Junio C HamanoSep 13, 2012
  19. Junio C HamanoSep 14, 2012
  20. Junio C HamanoSep 14, 2012
  21. 00/11 rev-list/log: document logic with several limiting optionsMichael J Gruber, Sep 14, 2012
  22. Junio C HamanoSep 14, 2012
  23. 01/11 grep: teach --debug option to dump the parse treeMichael J Gruber, Sep 14, 2012
  24. Junio C HamanoSep 14, 2012
  25. 02/11 log: name --debug-grep option like in the commit messageMichael J Gruber, Sep 14, 2012
  26. 03/11 grep: show --debug output only onceMichael J Gruber, Sep 14, 2012
  27. Junio C HamanoSep 14, 2012
  28. 04/11 log --grep/--author: honor --all-match honored for multiple --grep patternsMichael J Gruber, Sep 14, 2012
  29. 05/11 log: document use of multiple commit limiting optionsMichael J Gruber, Sep 14, 2012
  30. 06/11 fixup! log: document use of multiple commit limiting optionsMichael J Gruber, Sep 14, 2012
  31. Junio C HamanoSep 14, 2012
  32. 07/11 t7810-grep: bring log --grep tests in common formMichael J Gruber, Sep 14, 2012
  33. 08/11 t7810-grep: test multiple --grep with and without --all-matchMichael J Gruber, Sep 14, 2012
  34. 09/11 t7810-grep: test multiple --author with --all-matchMichael J Gruber, Sep 14, 2012
  35. Junio C HamanoSep 14, 2012
  36. 10/11 t7810-grep: test interaction of multiple --grep and --author optionsMichael J Gruber, Sep 14, 2012
  37. 11/11 t7810-grep: test --all-match with multiple --grep and --author optionsMichael J Gruber, Sep 14, 2012
  38. Junio C HamanoSep 14, 2012
  39. Michael J GruberSep 13, 2012
  40. Junio C HamanoSep 13, 2012
  41. Michael J GruberSep 14, 2012
  42. Junio C HamanoSep 14, 2012
  43. Michael J GruberSep 14, 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.