From: Junio C Hamano <gitster@pobox.com>
To: Illia Bobyr <illia.bobyr@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Long names for `git log -S` and `git log -G`
Date: Tue, 19 Nov 2024 12:52:50 +0900 [thread overview]
Message-ID: <xmqqo72bev71.fsf@gitster.g> (raw)
In-Reply-To: <24458598-ebbe-41fc-8517-457fa65ed481@gmail.com> (Illia Bobyr's message of "Mon, 18 Nov 2024 15:56:30 -0800")
Illia Bobyr <illia.bobyr@gmail.com> writes:
> Also,`diffcore` docs says:
>
>> "-G<regular-expression>" (mnemonic: grep)
>
> I was thinking of `--pickaxe` for `-S` and `--grep` for `-G`.
In the context of "git diff", calling "-G" "--grep" would be OK, but
in the context of "git log", there is "--grep" already, so that
won't fly.
> `--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).
> Not sure what would be a reasonably short alternative for `-S`.
> `--pickaxe-occurance-change` seems too long, and might not be as clear.
> `--pickaxe-occurance-count-change` is just way too long.
Giving a tool a meaningful name is an excellent idea. If the
meaningful name guides users to the right way to use the tool,
it would be ideal. Which means that to name it right, you'd need to
know what it exactly is for.
The -S feature was written to become one of the building blocks of
Linus's "clearly superior algorithm", described in [1]. Linus talks
about "where did this _line_ come from?", but the algorithm is more
generally about a block of code. The expected use case is for -S to
be fed sufficiently unique block of text so that we can efficiently
detect the transition of occurence count from 1 (because wee start
from sufficiently unique block of code) down to 0 (which is the
boundary in history where the block of code was first introduced in
its current form). It detects any occurence count change, but its
primary focus is to find a transition from 1 to 0 (when going
backwards in history). Its spirit is more about "finding where it
appeared in its current shape".
[Footnote]
*1* https://lore.kernel.org/git/Pine.LNX.4.58.0504150753440.7211@ppc970.osdl.org/
next prev parent reply other threads:[~2024-11-19 3:52 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 [this message]
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 ` [PATCH v2 0/1] " Illia Bobyr
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=xmqqo72bev71.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=illia.bobyr@gmail.com \
/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).