From: Junio C Hamano Date: Wed, 31 Mar 2021 00:14:28 GMT Subject: Re: [PATCH v2 22/22] pickaxe -G: don't special-case create/delete Message-ID: In-Reply-To: <20210216115801.4773-23-avarab@gmail.com> Ævar Arnfjörð Bjarmason 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 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.