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

Re: git log: invert --author and --committer

From
Per Cederqvist <cederp@opera.com>
Date
May 23, 2016, 21:21 UTC
Message-ID
<CAP=KgsSNgKY5gR3uSSMZdOxZ1687YRnQRQFsV22UwCXqmdfB9g@mail.gmail.com>
In-Reply-To
<xmqq37p8a84y.fsf@gitster.mtv.corp.google.com>
On Mon, May 23, 2016 at 9:26 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 37 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Per Cederqvist <cederp@opera.com> writes:
>>
>>>     git log --invert-grep --author cibot
>>...
>> Yeah, the author/committer search piggy-backs the more generic "grep
>> in the log" machinery, but it is quite hidden and the document
>> failed to tell the end users that is what is going on.  Mentioning
>> that invert (or any tweak that works on the grep machinery) affects
>> author/committer search is a good idea.
>>
>> Does "-i/--regexp-ignore-case" also need the same treatment?
>
> It seems it does.
>
> How about making this clarification not about --invert-grep but
> about --committer/--author option, perhaps like this?
>
>  Documentation/rev-list-options.txt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
> index 4f009d4..3fca366 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -44,6 +44,10 @@ endif::git-rev-list[]
>         expression).  With more than one `--author=<pattern>`,
>         commits whose author matches any of the given patterns are
>         chosen (similarly for multiple `--committer=<pattern>`).
> ++
> +Options that affect how a regular expression match is performed
> +(such as `-i`, `-E`, `--invert-grep`) can also be used affect these
> +options.
>
>  --grep-reflog=<pattern>::
>         Limit the commits output to ones with reflog entries that
"can also be used to affect", right? (I think the word "to" is missing.)

I think it does make sense to document this with the --author/--committer options.

That wording would however make me assume that --all-match could also be used, so that

    git log --all-match --author ceder --author cibot

would list nothing (since there are no authors that match both "ceder" and "cibot" in this codebase). That isn't the fact, though. It seems to list all commits that have either ceder or cibot as author, just as if I had not used --all-match.

As a reader of the man-page, I would prefer to have the exact list of options in the documentation. (I realize that it will make it harder to maintain.)

    /ceder
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “git log: invert --author and --committer”
  1. Per CederqvistMay 23, 2016
  2. Junio C HamanoMay 23, 2016
  3. Junio C HamanoMay 23, 2016
  4. Per CederqvistMay 23, 2016
  5. Junio C HamanoMay 23, 2016
  6. Junio C HamanoMay 23, 2016

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.