From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Progress report on git-blame Date: Sun, 26 Jan 2014 21:40:51 +0200 Message-ID: <83sisaa5vg.fsf@gnu.org> References: <20140109140226.57D6C38085A@snark.thyrsus.com> <20140110155121.GA8178@thyrsus.com> <20140111205925.GC17111@thyrsus.com> <87y52mdoha.fsf@fencepost.gnu.org> <87fvoceuos.fsf_-_@fencepost.gnu.org> <83d2jgcy5z.fsf@gnu.org> <87vbx8cu8a.fsf@fencepost.gnu.org> <87eh3v7wiq.fsf@building.gnus.org> <87r47v1x64.fsf@wanadoo.es> <83wqhmabl9.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1390765269 18459 80.91.229.3 (26 Jan 2014 19:41:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jan 2014 19:41:09 +0000 (UTC) Cc: ofv@wanadoo.es, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 26 20:41:15 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7VZz-0001m3-7a for ged-emacs-devel@m.gmane.org; Sun, 26 Jan 2014 20:41:15 +0100 Original-Received: from localhost ([::1]:56114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7VZy-0007HL-Sj for ged-emacs-devel@m.gmane.org; Sun, 26 Jan 2014 14:41:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7VZs-0007GU-13 for emacs-devel@gnu.org; Sun, 26 Jan 2014 14:41:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7VZm-00055n-UM for emacs-devel@gnu.org; Sun, 26 Jan 2014 14:41:07 -0500 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:54658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7VZm-00055I-Lk for emacs-devel@gnu.org; Sun, 26 Jan 2014 14:41:02 -0500 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0N0000300X01SL00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sun, 26 Jan 2014 21:41:00 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N00003E6XCCOB50@a-mtaout21.012.net.il>; Sun, 26 Jan 2014 21:41:00 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169141 Archived-At: > From: Stefan Monnier > Cc: ofv@wanadoo.es, emacs-devel@gnu.org > Date: Sun, 26 Jan 2014 14:05:17 -0500 > > > Perhaps we should define what it means "find the history of that chunk > > of text". I'm not sure we all talk about the same use case. > > Find the sequence of patches (with their corresponding log comments) > that results in that chunk of text (presented in reverse-chronological > order). How do you define "that chunk of text"? For the initial (latest) revision, the answer is clear. But, as you go backwards in time, the text becomes less and less similar to what it is today, and can also move around. So which revisions are relevant to "that chunk of text" becomes harder and harder to decide. What is today 10 lines could once be only one, and could have been moved from some other place, or constructed from several different parts, each one taken from a different place. Or something that is a function today might have been just a code fragment in the past, part of some other function. When we the humans look at the results of applying changes in reverse, we can make that decision because we know what we are looking for: some specific trait of the original code in which we are interested. But how can a program know that? How can you explain it what you are interested in? The usual pattern I apply 'annotate' goes like this: a) annotate foo.c, find the revision that changed "that chunk of text" b) examine the relevant parts of the diffs for that revision c) if the diffs don't show what I'm looking for, annotate foo.c as it was before that revision, and go back to b) The crucial parts here are (1) to examine the diffs, and (2) decide where are "the relevant parts" to look. How can we do this programmatically, so that the "history of that chunk of text" will indeed show what we want it to?