Re: [PATCH v2 22/22] pickaxe -G: don't special-case create/delete
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 31, 2021, 00:14 UTC
- Message-ID
- <xmqq1rbw9o2j.fsf@gitster.g>
- In-Reply-To
- <20210216115801.4773-23-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 12 quoted lines
> 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.