From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.bugs Subject: bug#8756: 23.3; vc-git.el doesn't use --follow argument in vc-git-print-log Date: Mon, 28 Nov 2011 21:21:49 +0100 Message-ID: <878vn0yp42.fsf@dod.no> References: <87sjrxl0r1.fsf@dod.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1322511977 21816 80.91.229.12 (28 Nov 2011 20:26:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2011 20:26:17 +0000 (UTC) Cc: 8756@debbugs.gnu.org To: Dan Nicolaescu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 28 21:26:13 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RV7mG-0001ck-Qz for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Nov 2011 21:26:12 +0100 Original-Received: from localhost ([::1]:38298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV7mG-0003FM-8Y for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Nov 2011 15:26:12 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV7mB-0003E2-O9 for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2011 15:26:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RV7mA-0000R6-Jd for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2011 15:26:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV7mA-0000R2-I5 for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2011 15:26:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RV7o1-0005Wm-Vq for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2011 15:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Steinar Bang Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Nov 2011 20:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8756 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8756-submit@debbugs.gnu.org id=B8756.132251202921170 (code B ref 8756); Mon, 28 Nov 2011 20:28:01 +0000 Original-Received: (at 8756) by debbugs.gnu.org; 28 Nov 2011 20:27:09 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RV7n9-0005VN-Gm for submit@debbugs.gnu.org; Mon, 28 Nov 2011 15:27:08 -0500 Original-Received: from rainey.bang.priv.no ([212.110.185.190]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RV7k2-0005QS-Nn for 8756@debbugs.gnu.org; Mon, 28 Nov 2011 15:23:56 -0500 In-Reply-To: (Dan Nicolaescu's message of "Tue, 31 May 2011 01:25:51 -0400") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.1 (gnu/linux) X-SA-Exim-Connect-IP: 84.208.231.161 X-SA-Exim-Rcpt-To: too long (recipient list exceeded maximum allowed size of 8 bytes) X-SA-Exim-Mail-From: sb@dod.no X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on rainey.bang.priv.no) X-Mailman-Approved-At: Mon, 28 Nov 2011 15:27:05 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 28 Nov 2011 15:28:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:54387 Archived-At: >>>>> Dan Nicolaescu : > I tried doing that at some point, but the result is not completely > functional, these commands do not work: > "d" (log-view-diff) > "f" (log-view-find-revision) > "a" (log-view-annotate-revision) Yes, I discovered the same thing. > which means that the corresponding vc-git.el functions need updating. > If someone figures out what git commands/sequence of commands are > needed to implement these, then it should not be too hard to implement > the needed changes. I decided to take a look at it again today. The first problem I ran into, was that the emacs 23.1 version of `vc-git-print-log' used "git rev-list" instead of "git log". And only "git log" supports "--follow" to track renames (at least that's what I concluded after googling for this today. *Please* correct me, if I'm wrong!). The difference between "git rev-list --pretty HEAD" and "git log" is that the rev-list has an extra blank line at the end. So I did an experiment letting `vc-git-print-log' use "git log" if there is only one file: #begin_example --- a/apps/share/emacs23/site-lisp/vc-git.el +++ b/apps/share/emacs23/site-lisp/vc-git.el @@ -459,8 +459,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches." (let ((inhibit-read-only t)) (with-current-buffer buffer - (vc-git-command buffer 'async files - "rev-list" "--pretty" "HEAD" "--"))))) + (if (= 1 (length flist)) + ;; If there's only one item, track renames using "git log --follow" + (vc-git-command buffer 'async files + "log" "--follow" "--") + (vc-git-command buffer 'async files + "rev-list" "--pretty" "HEAD" "--")))))) (defvar log-view-message-re) (defvar log-view-file-re) #end_example This had slightly more success than the first attempt: - `C-x v l' reports the full history (as in the previous attempt) - Now `d', `f', and `a' works for commits newer than the rename - After the rename - `d' no longer fails with "No next version", but reports no diff, where there should have been a diff #begin_example No changes between a92a3d062dac1b0ec5eece4ed6f9570e59f1a69b and 8d304db76993a0da0894b3d30794a2c5ec4927fe #end_example - `f' and `a' fails because the file doesn't exist #begin_example fatal: no such path apps/share/emacs23/site-lisp/vc-git.el in 8d304db76993a0da0894b3d30794a2c5ec4927fe #end_example On a side note: I'm testing for the length of flist, since I know that it's a list. But flist isn't used after its initial binding in the let clause, as far as I can see...?