Subject: Re: [PATCH v2 22/22] pickaxe -G: don't special-case create/delete

From: Junio C Hamano <[email-masked]>
Date: Tue, 30 Mar 2021 17:14:28 -0700

Ævar Arnfjörð Bjarmason  <[email-masked]> writes:

> Instead of special-casing creations and deletions let's just generate
> a diff for them.
>
> This logic of not running a diff under -G if we don't have both sides
> dates back to the original implementation of -S in
> 52e9578985f ([PATCH] Introducing software archaeologist's tool
> "pickaxe"., 2005-05-21).
>
> In the case of -S we were not working with the xdiff interface and
> needed to do this, but when -G was implemented in f506b8e8b5f (git
> log/diff: add -G<regexp> that greps in the patch text, 2010-08-23)
> this logic was diligently copied over.

Nicely analized.  Yes, I agree that -G that special cases deletion
and creation is just being silly, mimicking what -S did without
thinking.  I can imagine that running grep over diff output in
normal case, and having to run grep over a single side in the edge
cases, would require unnecessary code duplication.