git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Max Coplan via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Cc: Max Coplan <mchcopl@gmail.com>
Subject: Re: [PATCH] feat(log): add option to search for header or body to `git log`
Date: Sat, 6 Apr 2024 15:04:37 +0100	[thread overview]
Message-ID: <c93817ba-5945-4ec0-9775-5621481b972c@gmail.com> (raw)
In-Reply-To: <pull.1710.git.1712353687464.gitgitgadget@gmail.com>

Hi Max

On 05/04/2024 22:48, Max Coplan via GitGitGadget wrote:
> From: =?UTF-8?q?Max=20=F0=9F=91=A8=F0=9F=8F=BD=E2=80=8D=F0=9F=92=BB=20Copl?=
>   =?UTF-8?q?an?= <mchcopl@gmail.com>
> 
> Note to reviewer: I hate the name `--header-or`!  Please help me come up
> with a better name.
> 
> Summary:
> This change adds a new option to `git log` that allows users to search
> for commits that match either the author or the commit message. This is
> useful for finding commits that were either authored or co-authored by a
> specific person.

I think that having a way to find all the commits that are authored by, 
or have a specific trailer naming someone is a good idea. I'm not sure 
about combining "--author" with "--grep" to do it though. Perhaps we 
could design a new option (tentatively called "--indent") that allows 
the user to specify a name and which trailers and commit headers (author 
and/or committer) to match.

A couple of house keeping notes. We do not use the "feat(...)" style of 
commit messages in this project. The subject line should just start with 
"log: " the rest of the subject looks fine. I think everything under the 
"Summary:" line above does a good job of explaining why the change is 
useful which is great. We tend to avoid emoji's in peoples names as well.

 > [...]
> +test_expect_success 'log --grep --author --header-or uses union' '
> +	# grep matches only third and fourth
> +	# author matches only initial and third

I'm a bit confused by this comment as we seem to only expect "third" and 
"fourth" below - what happened to "initial"?

> +	git log --author="A U Thor" --grep=r --header-or --format=%s >actual &&
> +	{
> +	    echo fourth && echo third
> +	} >expect &&

We have a test helper to help with this

     test_write_lines fourth third >expect

Best Wishes

Phillip


  reply	other threads:[~2024-04-06 14:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 21:48 [PATCH] feat(log): add option to search for header or body to `git log` Max Coplan via GitGitGadget
2024-04-06 14:04 ` Phillip Wood [this message]
2024-04-07  3:24 ` [PATCH v2] log: add option to search for header or body Max Coplan via GitGitGadget
2024-04-07  6:08   ` Junio C Hamano
2024-04-07 14:00     ` Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c93817ba-5945-4ec0-9775-5621481b972c@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=mchcopl@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).