git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Illia Bobyr <illia.bobyr@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Cc: Illia Bobyr <illia.bobyr@gmail.com>, git@vger.kernel.org
Subject: [PATCH v2 0/1] Long names for `git log -S` and `git log -G`
Date: Tue,  4 Feb 2025 18:24:19 -0800	[thread overview]
Message-ID: <20250205022422.2019929-1-illia.bobyr@gmail.com> (raw)
In-Reply-To: <xmqqserjsfrq.fsf@gitster.g>

Sorry, I dropped the ball on this.
I still think it would be good to get it done.

> On 11/22/24 02:51, Junio C Hamano wrote:
> >>> `--pickaxe-grep` for `-G` seems like a reasonable alternative name for `-G`.
> >> That is probably OK (even though "-G" is not exactly what the
> >> pickaxe machinery wants to do; "--grep-in-patch" might be closer to
> >> the intent).
> > Imagining, that I am starting from scratch for this functionality, I think I
> > would also consider "patch".  Though, as we have 4 related argument names, I
> > wonder if using it as a prefix would create a more consistent UX.
> >
> > Something like:
> >
> > "--patch-grep" for "-G"
> > "--patch-modifies" for "-S"
>
> Ahh, "modifies" is a great verb.  It sounds quite logical, but "-S"
> does not have to generate a patch internally for it to work, so
> "--patch-modifies" is a bit of white lie.

Used "--patch-modifies" for the second version of the patch.

I think most people (certainly me) think about patches first, when they look at
these commands.  They are unlikely to realize right away that generating a patch
is more expensive than counting the string/regex occurrences in the pre- and
post- images.  So, if you consider the "it behaves as if" point of view rather
than "this is how it works" point of view, it is not even a lie :)

> > "--patch-search-show-all"/"--patch-show-all" for "--pickaxe-all"
> > "--patch-search-regex"/"--patch-regex" for "--pickaxe-regex"
>
> These already have their own established long names, so it is
> outside the scope of this topic, and I doubt it is worth giving
> these additional aliases (as you seem to agree).

I do not have a strong feeling on this one.  If "-S" and/or "-G" would get names
that do not start with a "--pickaxe" it might be a bit confusing that the flags
that affect their behavior do have the "--pickaxe" prefix.  If this is a valid
concern, I could probably create a separate patch to add alternative names.

---

I've updated the patch with the following names:

"--patch-grep" for "-G"
"--patch-modifies" for "-S"

On 11/19/24 10:58, Jeff King wrote:
> FWIW, I like --grep-in-patch. Saying just "--pickaxe-grep" does not
> highlight that it is about looking in the patch. I.e., it is not clear
> from the name that is different from "-Sfoo --pickaxe-regex".

Is "--patch-grep" a good alternative?  I think, using the same prefix for a
functionality that looks quite similar from the user standpoint ("-G" and "-S")
seems nice.  Using "--grep-in-patch" for "-G", "--patch-modifies" for "-S" and
"--pickaxe-regex"/"--pickaxe-all" all at the same time seems less consistent,
but I can change it if you insist.

Illia Bobyr (1):
  diff: --patch{-modifies,grep} arg names for -S and -G

 Documentation/diff-options.txt |  36 +++++------
 Documentation/git-blame.txt    |   2 +-
 Documentation/gitdiffcore.txt  |  48 ++++++++-------
 diff.c                         |  18 +++---
 diff.h                         |  11 +++-
 gitk-git/gitk                  |  10 +++-
 t/t4062-diff-pickaxe.sh        |   8 +--
 t/t4209-log-pickaxe.sh         | 106 +++++++++++++++++++++++----------
 8 files changed, 151 insertions(+), 88 deletions(-)

-- 
2.45.2


  reply	other threads:[~2025-02-05  2:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-18 23:56 Long names for `git log -S` and `git log -G` Illia Bobyr
2024-11-19  3:52 ` Junio C Hamano
2024-11-19 18:58   ` Jeff King
2024-11-21 23:31     ` Illia Bobyr
2024-11-22 10:51       ` Junio C Hamano
2025-02-05  2:24         ` Illia Bobyr [this message]
2025-02-05  2:24         ` [PATCH v2 1/1] diff: --patch{-modifies,grep} arg names for -S and -G Illia Bobyr
2025-02-05  7:15           ` Johannes Sixt

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

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

  git send-email \
    --in-reply-to=20250205022422.2019929-1-illia.bobyr@gmail.com \
    --to=illia.bobyr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
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 NNTP newsgroup(s).