From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [RFC PATCH, WAS: "weird diff output?" 0/2] implement better chunk heuristics Date: Fri, 15 Apr 2016 10:27:31 -0700 Message-ID: References: <20160415165141.4712-1-jacob.e.keller@intel.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Jacob Keller , "git\@vger.kernel.org" , Jeff King , Jens Lehmann , Davide Libenzi , Jacob Keller To: Stefan Beller X-From: git-owner@vger.kernel.org Fri Apr 15 19:27:39 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ar7Wt-0006Oz-63 for gcvg-git-2@plane.gmane.org; Fri, 15 Apr 2016 19:27:39 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751337AbcDOR1f (ORCPT ); Fri, 15 Apr 2016 13:27:35 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:60589 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750890AbcDOR1e (ORCPT ); Fri, 15 Apr 2016 13:27:34 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 13BED1411E; Fri, 15 Apr 2016 13:27:33 -0400 (EDT) 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; s=sasl; bh=ZYL8ENjw2fYEBfzEgrLY4oXNN9I=; b=Gc/+pa OADAIcxRyd5XTjn7eptH7i5MAQe0h7Cz0FbkQqgcoRRH5d+mUm0E+TLGdT8SPSL6 bmZLsoVLidoY2oYMm0nef4X9Gh/peAo5Mtolw+HYA0BzS1hSrcmu+bgR7CmHRDNI N5L/IfRBfH9ART63OdbfB7QPpP5f49BHL6xpg= 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; q=dns; s=sasl; b=tppAPKwVFJxHGMCT8rW8X57wizWRwBTE pq3Y5X2Oz4n2X/FLqkXxd4JSVQX+mhrfUleVTb6kp6cRYPyiQxdffFOdD3Iir4oI 2xPQWfmrcZFTcAzy3I4SRbh835SDZQvP4RVlZfuo2bvOHsDgSjAw+tx6z1D9KpXU IcEiowCtcpE= Received: from pb-smtp1. (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 0C1571411D; Fri, 15 Apr 2016 13:27:33 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 524571411C; Fri, 15 Apr 2016 13:27:32 -0400 (EDT) In-Reply-To: (Stefan Beller's message of "Fri, 15 Apr 2016 10:10:31 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Pobox-Relay-ID: 5617EB28-032F-11E6-BD65-9A9645017442-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Stefan Beller writes: > Actually we would only need to have the empty line count in the > second loop as the first loop shifted it as much up(backwards) as > possible, such that the hunk sits on one end of the movable > range. The second loop would iterate over the whole range, so that > would be the only place needed to count. The description makes me wonder if we can do without two loops ;-) That is, can we teach the first loop not to be so aggressive to shift "as much as possible" but notice there is an empty line we would want to treat specially?