{"thread":{"id":"42417","subject":"git log: invert --author and --committer","startedAt":"2016-05-23T09:54:45Z","lastAt":"2016-05-23T21:47:10Z","messageCount":6,"participants":["Per Cederqvist","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"287236","messageId":"CAP=KgsSdX3pCRzeUVobrFWVGOGGSrwkO0MjFhUWruiajAxn38Q@mail.gmail.com","threadId":"42417","inReplyTo":null,"subject":"git log: invert --author and --committer","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2016-05-23T09:54:45Z","receivedAt":"2016-05-23T09:54:45Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"We have a repository that mostly contains configuration data.\nThis is updated by our continuous integration build system, but\nevery once in a while there are also more interesting commits\nmade by humans.\n\nFor several years I have suffered in silence, wishing for a way\nto do something like\n\n    git log --author-not cibot\n\nToday a friend told me that you can actually list all commits\nexcept those made by cibot with this commandline:\n\n    git log --invert-grep --author cibot\n\nThe documentation for --invert-grep should mention that it\nalso inverts the meaning of --author and --committer.  Perphaps\nsomething like this would make sense?\n\n    /ceder\n\ndiff --git a/Documentation/rev-list-options.txt\nb/Documentation/rev-list-options.txt\nindex 4f009d4..ae12687 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -70,7 +70,8 @@ endif::git-rev-list[]\n\n --invert-grep::\n  Limit the commits output to ones with log message that do not\n- match the pattern specified with `--grep=<pattern>`.\n+ match the pattern specified with `--grep=<pattern>`.  Also\n+ affects `--author=<pattern>` and `--committer=<pattern>`.\n\n -i::\n --regexp-ignore-case::\n"},{"id":"287260","messageId":"xmqqmvngaedn.fsf@gitster.mtv.corp.google.com","threadId":"42417","inReplyTo":"CAP=KgsSdX3pCRzeUVobrFWVGOGGSrwkO0MjFhUWruiajAxn38Q@mail.gmail.com","subject":"Re: git log: invert --author and --committer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-23T17:11:16Z","receivedAt":"2016-05-23T17:11:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Per Cederqvist <cederp@opera.com> writes:\n\n> We have a repository that mostly contains configuration data.\n> This is updated by our continuous integration build system, but\n> every once in a while there are also more interesting commits\n> made by humans.\n>\n> For several years I have suffered in silence, wishing for a way\n> to do something like\n>\n>     git log --author-not cibot\n>\n> Today a friend told me that you can actually list all commits\n> except those made by cibot with this commandline:\n>\n>     git log --invert-grep --author cibot\n>\n> The documentation for --invert-grep should mention that it\n> also inverts the meaning of --author and --committer.  Perphaps\n> something like this would make sense?\n>\n>     /ceder\n\nYeah, the author/committer search piggy-backs the more generic \"grep\nin the log\" machinery, but it is quite hidden and the document\nfailed to tell the end users that is what is going on.  Mentioning\nthat invert (or any tweak that works on the grep machinery) affects\nauthor/committer search is a good idea.\n\nDoes \"-i/--regexp-ignore-case\" also need the same treatment?\n\n> diff --git a/Documentation/rev-list-options.txt\n> b/Documentation/rev-list-options.txt\n> index 4f009d4..ae12687 100644\n> --- a/Documentation/rev-list-options.txt\n> +++ b/Documentation/rev-list-options.txt\n> @@ -70,7 +70,8 @@ endif::git-rev-list[]\n>\n>  --invert-grep::\n>   Limit the commits output to ones with log message that do not\n> - match the pattern specified with `--grep=<pattern>`.\n> + match the pattern specified with `--grep=<pattern>`.  Also\n> + affects `--author=<pattern>` and `--committer=<pattern>`.\n>\n>  -i::\n>  --regexp-ignore-case::\n"},{"id":"287274","messageId":"xmqq37p8a84y.fsf@gitster.mtv.corp.google.com","threadId":"42417","inReplyTo":"xmqqmvngaedn.fsf@gitster.mtv.corp.google.com","subject":"Re: git log: invert --author and --committer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-23T19:26:05Z","receivedAt":"2016-05-23T19:26:05Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Per Cederqvist <cederp@opera.com> writes:\n>\n>>     git log --invert-grep --author cibot\n>...\n> Yeah, the author/committer search piggy-backs the more generic \"grep\n> in the log\" machinery, but it is quite hidden and the document\n> failed to tell the end users that is what is going on.  Mentioning\n> that invert (or any tweak that works on the grep machinery) affects\n> author/committer search is a good idea.\n>\n> Does \"-i/--regexp-ignore-case\" also need the same treatment?\n\nIt seems it does.\n\nHow about making this clarification not about --invert-grep but\nabout --committer/--author option, perhaps like this?\n\n Documentation/rev-list-options.txt | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 4f009d4..3fca366 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -44,6 +44,10 @@ endif::git-rev-list[]\n \texpression).  With more than one `--author=<pattern>`,\n \tcommits whose author matches any of the given patterns are\n \tchosen (similarly for multiple `--committer=<pattern>`).\n++\n+Options that affect how a regular expression match is performed\n+(such as `-i`, `-E`, `--invert-grep`) can also be used affect these\n+options.\n \n --grep-reflog=<pattern>::\n \tLimit the commits output to ones with reflog entries that\n"},{"id":"287314","messageId":"CAP=KgsSNgKY5gR3uSSMZdOxZ1687YRnQRQFsV22UwCXqmdfB9g@mail.gmail.com","threadId":"42417","inReplyTo":"xmqq37p8a84y.fsf@gitster.mtv.corp.google.com","subject":"Re: git log: invert --author and --committer","fromName":"Per Cederqvist","fromEmail":"cederp@opera.com","sentAt":"2016-05-23T21:21:32Z","receivedAt":"2016-05-23T21:21:32Z","isPatch":false,"sender":{"key":"cederp@opera.com","avatar":"https://gravatar.com/avatar/008fe28caedea0ba34042cd5157705267934f4ba7a9b29fb248ae18ec5b3055e?d=mp&s=160"},"body":"On Mon, May 23, 2016 at 9:26 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Per Cederqvist <cederp@opera.com> writes:\n>>\n>>>     git log --invert-grep --author cibot\n>>...\n>> Yeah, the author/committer search piggy-backs the more generic \"grep\n>> in the log\" machinery, but it is quite hidden and the document\n>> failed to tell the end users that is what is going on.  Mentioning\n>> that invert (or any tweak that works on the grep machinery) affects\n>> author/committer search is a good idea.\n>>\n>> Does \"-i/--regexp-ignore-case\" also need the same treatment?\n>\n> It seems it does.\n>\n> How about making this clarification not about --invert-grep but\n> about --committer/--author option, perhaps like this?\n>\n>  Documentation/rev-list-options.txt | 4 ++++\n>  1 file changed, 4 insertions(+)\n>\n> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\n> index 4f009d4..3fca366 100644\n> --- a/Documentation/rev-list-options.txt\n> +++ b/Documentation/rev-list-options.txt\n> @@ -44,6 +44,10 @@ endif::git-rev-list[]\n>         expression).  With more than one `--author=<pattern>`,\n>         commits whose author matches any of the given patterns are\n>         chosen (similarly for multiple `--committer=<pattern>`).\n> ++\n> +Options that affect how a regular expression match is performed\n> +(such as `-i`, `-E`, `--invert-grep`) can also be used affect these\n> +options.\n>\n>  --grep-reflog=<pattern>::\n>         Limit the commits output to ones with reflog entries that\n\n\"can also be used to affect\", right? (I think the word \"to\" is missing.)\n\nI think it does make sense to document this with the --author/--committer\noptions.\n\nThat wording would however make me assume that --all-match could also\nbe used, so that\n\n    git log --all-match --author ceder --author cibot\n\nwould list nothing (since there are no authors that match both\n\"ceder\" and \"cibot\" in this codebase).  That isn't the fact, though.\nIt seems to list all commits that have either ceder or cibot as author,\njust as if I had not used --all-match.\n\nAs a reader of the man-page, I would prefer to have the exact list\nof options in the documentation.  (I realize that it will make it harder\nto maintain.)\n\n    /ceder\n"},{"id":"287316","messageId":"xmqq1t4s8nzr.fsf@gitster.mtv.corp.google.com","threadId":"42417","inReplyTo":"CAP=KgsSNgKY5gR3uSSMZdOxZ1687YRnQRQFsV22UwCXqmdfB9g@mail.gmail.com","subject":"Re: git log: invert --author and --committer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-23T21:26:32Z","receivedAt":"2016-05-23T21:26:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Per Cederqvist <cederp@opera.com> writes:\n\n> \"can also be used to affect\", right? (I think the word \"to\" is missing.)\n\nCorrect.\n\n> That wording would however make me assume that --all-match could also\n> be used, so that\n>\n>     git log --all-match --author ceder --author cibot\n>\n> would list nothing (since there are no authors that match both\n> \"ceder\" and \"cibot\" in this codebase).  That isn't the fact, though.\n\nThat is because \"--all-match\" does not affect \"how a regular\nexpression match is performed\".  The option affects the way how the\nresults from these multiple regular expression matches are combined.\n\n> It seems to list all commits that have either ceder or cibot as author,\n> just as if I had not used --all-match.\n>\n> As a reader of the man-page, I would prefer to have the exact list\n> of options in the documentation.  (I realize that it will make it harder\n> to maintain.)\n"},{"id":"287320","messageId":"xmqqshx878gx.fsf@gitster.mtv.corp.google.com","threadId":"42417","inReplyTo":"CAP=KgsSNgKY5gR3uSSMZdOxZ1687YRnQRQFsV22UwCXqmdfB9g@mail.gmail.com","subject":"Re: git log: invert --author and --committer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-23T21:47:10Z","receivedAt":"2016-05-23T21:47:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Per Cederqvist <cederp@opera.com> writes:\n\n> I think it does make sense to document this with the --author/--committer\n> options.\n>\n> That wording would however make me assume that --all-match could also\n> be used, so that\n>\n>     git log --all-match --author ceder --author cibot\n>\n> would list nothing (since there are no authors that match both\n> \"ceder\" and \"cibot\" in this codebase).  That isn't the fact, though.\n> It seems to list all commits that have either ceder or cibot as author,\n> just as if I had not used --all-match.\n>\n> As a reader of the man-page, I would prefer to have the exact list\n> of options in the documentation.  (I realize that it will make it harder\n> to maintain.)\n>\n>     /ceder\n\nOk, take 2.\n\nThis makes `--all-match` the only one that explicitly mentions that\nthe option applies to patterns given with the `--grep` option; from\nan end-user's point of view, --author/--committer is not given via\nthe `--grep` option, so it may help to alleviate the above issue.\n\nAll others use \"limiting patterns\" consistently, so that eyeballing\nfor the phrase would catch things like \"--invert-grep\", \"-E\", etc.\nand it would be easier to keep future additions to conform to the\nconvention, hopefully.\n\n Documentation/rev-list-options.txt | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 4f009d4..51ead72 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -44,6 +44,10 @@ endif::git-rev-list[]\n \texpression).  With more than one `--author=<pattern>`,\n \tcommits whose author matches any of the given patterns are\n \tchosen (similarly for multiple `--committer=<pattern>`).\n++\n+Options that affect how a limiting pattern matches (listed below,\n+such as `-i`, `-E`, `--invert-grep`) can also be used to affect\n+these options.\n \n --grep-reflog=<pattern>::\n \tLimit the commits output to ones with reflog entries that\n@@ -70,7 +74,7 @@ endif::git-rev-list[]\n \n --invert-grep::\n \tLimit the commits output to ones with log message that do not\n-\tmatch the pattern specified with `--grep=<pattern>`.\n+\tmatch the regular expression limiting patterns.\n \n -i::\n --regexp-ignore-case::\n"}]}