From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Phil Sainty" Newsgroups: gmane.emacs.bugs Subject: bug#15696: 24.3; vc-git-annotate-command -- ambiguous short commit hashes cause failures Date: Thu, 24 Oct 2013 11:36:31 +1300 (NZDT) Message-ID: <60659.202.78.240.7.1382567791.squirrel@mail.orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1382567900 28516 80.91.229.3 (23 Oct 2013 22:38:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2013 22:38:20 +0000 (UTC) To: 15696@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 24 00:38:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VZ74I-00054V-AJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2013 00:38:22 +0200 Original-Received: from localhost ([::1]:51702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ74H-0000SM-F6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 23 Oct 2013 18:38:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ747-0000Ry-Cc for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:38:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZ740-0004qY-8D for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:38:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ740-0004qT-4e for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:38:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VZ73z-0005gM-FW for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:38:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Phil Sainty" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Oct 2013 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138256783121757 (code B ref -1); Wed, 23 Oct 2013 22:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Oct 2013 22:37:11 +0000 Original-Received: from localhost ([127.0.0.1]:39110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ737-0005eo-SA for submit@debbugs.gnu.org; Wed, 23 Oct 2013 18:37:10 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55000) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZ734-0005cu-S9 for submit@debbugs.gnu.org; Wed, 23 Oct 2013 18:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZ72s-0004jy-DG for submit@debbugs.gnu.org; Wed, 23 Oct 2013 18:37:01 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:56387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ72s-0004ju-A3 for submit@debbugs.gnu.org; Wed, 23 Oct 2013 18:36:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ72m-0000Ob-1c for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:36:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZ72c-0004hE-Si for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:36:47 -0400 Original-Received: from nctlincom01.orcon.net.nz ([60.234.4.69]:38559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZ72c-0004gW-BU for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:36:38 -0400 Original-Received: from mx5.orcon.net.nz (mx5.orcon.net.nz [219.88.242.55]) by nctlincom01.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9NMh7vB006249 for ; Thu, 24 Oct 2013 11:43:08 +1300 Original-Received: from Debian-exim by mx5.orcon.net.nz with local (Exim 4.69) (envelope-from ) id 1VZ72V-0003LF-OO for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 11:36:31 +1300 Original-Received: from [172.16.100.200] (helo=mail.orcon.net.nz) by mx5.orcon.net.nz with esmtp (Exim 4.69) (envelope-from ) id 1VZ72V-0003L7-L5 for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 11:36:31 +1300 Original-Received: from 202.78.240.7 (SquirrelMail authenticated user 15631029) by mail.orcon.net.nz with HTTP; Thu, 24 Oct 2013 11:36:31 +1300 (NZDT) User-Agent: SquirrelMail/1.4.5 X-Priority: 3 (Normal) Importance: Normal X-DSPAM-Check: by mx5.orcon.net.nz on Thu, 24 Oct 2013 11:36:31 +1300 X-DSPAM-Result: Innocent X-DSPAM-Processed: Thu Oct 24 11:36:31 2013 X-DSPAM-Confidence: 0.5306 X-DSPAM-Probability: 0.0000 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, default) X-CanIt-Geo: No geolocation information available for 172.16.100.200 X-CanItPRO-Stream: base:default X-Canit-Stats-ID: 06KEKH8wu - 78494ee1ba39 - 20131024 X-Scanned-By: CanIt (www . roaringpenguin . com) on 172.16.100.174 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:79558 Archived-At: `vc-git-annotate-command' looks like this: (defun vc-git-annotate-command (file buf &optional rev) (let ((name (file-relative-name file))) (vc-git-command buf 'async nil "blame" "--date=iso" "-C" "-C" rev "--" name))) By default, git blame produces short commit hashes. You need to pass the -l argument to make it produce full hashes. This is a problem if the short hash is ambiguous, as none of the vc-annotate commands for interacting with that commit work. Example errors for ambiguous commit hash 7b10edf8: 'f' (`vc-annotate-find-revision-at-line'): Checking out (filename).~7b10edf8~... vc-do-command: Running git cat-file blob 7b... ....FAILED (status 128) 'D' (`vc-annotate-show-changeset-diff-revision-at-line'): Cannot diff from any revision prior to 7b10edf8 'l' (`vc-annotate-show-log-revision-at-line'): error: short SHA1 7b10edf8 is ambiguous. fatal: bad revision '7b10edf8' 'a' (`vc-annotate-revision-previous-to-line'): vc-annotate-warp-revision: Invalid argument to vc-annotate-warp-revision On the command line: $ git show 7b10edf8 error: short SHA1 7b10edf8 is ambiguous. error: short SHA1 7b10edf8 is ambiguous. fatal: ambiguous argument '7b10edf8': unknown revision or path not in the working tree. Use '--' to separate paths from revisions I suspect the best solution is to pass -l by default, and perhaps *hide* the remainder of the full commit hash in the annotate buffer -- but internally always utilise the full hash for all commands. (Will this also be a problem elsewhere in the vc-git support?) -Phil In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2) of 2013-03-12 on shodan Windowing system distributor `The X.Org Foundation', version 11.0.11103000 System Description: Ubuntu 12.04.3 LTS Configured using: `configure '--prefix=/home/phil/emacs/emacs24/emacs-24.3/usr/local'' Important settings: value of $LANG: en_NZ.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x r e p o r t - e m Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)