From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 4C1A51F4B4 for ; Wed, 31 Mar 2021 00:15:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232394AbhCaAO5 (ORCPT ); Tue, 30 Mar 2021 20:14:57 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:55183 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhCaAOc (ORCPT ); Tue, 30 Mar 2021 20:14:32 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 9526812F053; Tue, 30 Mar 2021 20:14:32 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=+f0yYXLQ6bmt tK0mTX3itEVRbmI=; b=w0NW4/FtHfSGCWpoKHToFj98rTazfdnZ2Cv3Fdc2PDFs b/RHTgsoake7RcgC0EColWLjZL8FRa5tNJSwo7+IOFvvrjHAXEUZUhaKBqb56Cqv 1Z6+gTG+Evx/idQfV4QPU2I+dxwpvA6vDge2koSYD/J2Z5U+lpLpuvsyPFjBhbc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=ix7zMk znXWMQdVYVZTrqQeB+dEWYSaISlqNYOKMNDoSlcuFojJch3dPUiZkFKLAM8ZgPc8 6Yg453tc7JJ8Xqy1cTWPp81Ga20dMbFEaH0Tr2fzmJlFl0VVeyxyGr9Wx3nbBcEo MkUnWp/niT5Ens+KIhgPbz30ufUi8tHq+n0VU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 8DB6A12F052; Tue, 30 Mar 2021 20:14:32 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id CB4A212F050; Tue, 30 Mar 2021 20:14:29 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Jeff King , Johannes Schindelin , Carlo Marcelo Arenas =?utf-8?Q?Bel=C3=B3n?= Subject: Re: [PATCH v2 22/22] pickaxe -G: don't special-case create/delete References: <20210203032811.14979-1-avarab@gmail.com> <20210216115801.4773-23-avarab@gmail.com> Date: Tue, 30 Mar 2021 17:14:28 -0700 In-Reply-To: <20210216115801.4773-23-avarab@gmail.com> (=?utf-8?B?IsOGdmFy?= =?utf-8?B?IEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Tue, 16 Feb 2021 12:58:01 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: 0FB45B10-91B6-11EB-B07F-E43E2BB96649-77302942!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 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.