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

Re: Supporting "-v" option for git-log

From
ELElazar Leibovich <elazarl@gmail.com>
Date
May 25, 2011, 11:40 UTC
Message-ID
<BANLkTimWymFNC7hP=X2w0RMwdLPjGC07Aw@mail.gmail.com>
In-Reply-To
<SNT124-W15FA6D1CACA43B253810FAC4740@phx.gbl>
On Wed, May 25, 2011 at 2:35 PM, Tim Mazid <timmazid@hotmail.com> wrote:
Show 8 quoted lines
>
>> git log --all --not --grep A --grep B
>>
>> Would mean find all commits without A and with B, in SQL "SELECT *
>> FROM COMMITS WHERE message NOT LIKE '%A%' AND message LIKE '%B%'".
>
> But how do you know which "--grep" the "--not" applies to? Does it have
> to go directly before the "--grep" option?
Exactly, just like the ! operator in C.
> Can it be a few options before
> as long is it's still before?
No, only directly before the --grep, like the ! operator.
> If you want to find commits not matching two
> patterns, do you have to do "--not --grep A --not --grep B"?
Yes, we can add a --negate-all option if you think it's usefull.
>
> I can see this as being a possible source of confusion; people doing
> "--not grep A --grep B" and expecting it to mean NOT A AND NOT B.

You can add another option --negate which negates everything. But this is a price to pay for being extra expressive.

Previous: Tim MazidNext: Jeff King
Message 8 of 14 in “Supporting "-v" option for git-log”
  1. Elazar LeibovichMay 25, 2011
  2. Tim MazidMay 25, 2011
  3. Elazar LeibovichMay 25, 2011
  4. Tim MazidMay 25, 2011
  5. Tim MazidMay 25, 2011
  6. Elazar LeibovichMay 25, 2011
  7. Tim MazidMay 25, 2011
  8. Elazar LeibovichMay 25, 2011
  9. Jeff KingMay 25, 2011
  10. Jakub NarebskiMay 25, 2011
  11. Jeff KingMay 25, 2011
  12. Jakub NarebskiMay 25, 2011
  13. Junio C HamanoMay 25, 2011
  14. Jeff KingMay 25, 2011

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.