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

Re: [PATCH v2] log: teach --invert-grep option

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 13, 2015, 18:25 UTC
Message-ID
<xmqqfvbeedxf.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1421112812-13578-1-git-send-email-ottxor@gentoo.org>
Christoph Junghans <ottxor@gentoo.org> writes:
Show 16 quoted lines
> "git log --grep=<string>" shows only commits with messages that
> match the given string, but sometimes it is useful to be able to
> show only commits that do *not* have certain messages (e.g. "show
> me ones that are not FIXUP commits").
>
> Originally, we had the invert-grep flag in grep_opt, but because
> "git grep --invert-grep" does not make sense except in conjunction
> with "--files-with-matches", which is already covered by
> "--files-without-matches", it was moved it to revisions structure.
> To have the flag there expresses the function to the feature better.
>
> When the newly inserted two tests run, the history would have commits
> with messages "initial", "second", "third", "fourth", "fifth", "sixth"
> and "Second", committed in this order.  The commits that does not match
> either "th" or "Sec" is "second" and "initial". For the case insensitive
> case only "initial" matches.

I see you moved the two bits meant only to be useful during the review to the commit message proper. The reason why I omitted the "Originally, ..." part was because those who are reading "git log -p" output would not know what the earlier draft had.

I do not mind it either way, though, so let's take this version.

However, I'd have to drop gitk-git/ bit; that part of the tree is maintained separately and comes from Paul's gitk repository. I'll forward only that part of the patch to him when this feature graduates to 'master'.

Thanks.
Previous: Christoph JunghansNext: Junio C Hamano
Message 13 of 15 in “git-log: added --invert-grep option”
  1. git-log: added --invert-grep optionChristoph Junghans, Dec 19, 2014
  2. Junio C HamanoDec 19, 2014
  3. Christoph JunghansDec 24, 2014
  4. git-log: added --grep-begin .. --grep-end syntaxChristoph Junghans, Dec 24, 2014
  5. Junio C HamanoDec 29, 2014
  6. git-log: added --none-match optionChristoph Junghans, Jan 4, 2015
  7. Junio C HamanoJan 6, 2015
  8. Christoph JunghansJan 9, 2015
  9. Junio C HamanoJan 9, 2015
  10. Junio C HamanoJan 12, 2015
  11. git-log: added --none-match optionChristoph Junghans, Jan 12, 2015
  12. log: teach --invert-grep optionChristoph Junghans, Jan 13, 2015
  13. Junio C HamanoJan 13, 2015
  14. gitk: pass --invert-grep option down to "git log"Junio C Hamano, Feb 16, 2015
  15. Paul MackerrasMar 22, 2015

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.