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

Inverting the --committer option to git-log with v1.7.5.4

From
TJTodd A. Jacobs <nospam+listmail@codegnome.org>
Date
Aug 26, 2012, 22:30 UTC
Message-ID
<CAPRhCbuOsiHNOHJUTN8Na9qEqoTAbCb-G41WFscjYhDppKOLGg@mail.gmail.com>
In-Reply-To
<CAPRhCbtfx+kA8BbPwSYcYfvg5S0b6yWP5TqJHD_LCN-CMFw75w@mail.gmail.com>

I wanted to search a repository for all commits that were *not* committed by a particular person. While I eventually managed to build a regular expression that worked for my limited use case, it seems like there ought to be a more sensible way to find the data I'm looking for.

As an example, this didn't work:
    git log --format=fuller --not --committer="Foo Bar"

Apparently, the --not flag doesn't invert the grep for committer; it only inverts the revision specifiers. It seems like there should be something that works like grep's --invert-match option, but I couldn't find it.

On the other hand, this will work, but is painful and error-prone to build if you have a lot of committers:

    # Assuming the address is foo.bar@example.com
    git log --format=fuller --committer='[^r]@'

Is there currently a better way to request logs for "everyone but committer x" in Git? If not, is this a feature that someone who understands the Git source might find useful enough to add in?

Next: Junio C Hamano
Message 1 of 2 in “Inverting the --committer option to git-log with v1.7.5.4”
  1. Todd A. JacobsAug 26, 2012
  2. Junio C HamanoAug 26, 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.