GNU bug report logs - #15696
24.3; vc-git-annotate-command -- ambiguous short commit hashes cause failures

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "Phil Sainty" <psainty@HIDDEN>; dated Wed, 23 Oct 2013 22:38:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Oct 2013 22:37:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 23 18:37:11 2013
Received: from localhost ([127.0.0.1]:39110 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VZ737-0005eo-SA
	for submit <at> debbugs.gnu.org; Wed, 23 Oct 2013 18:37:10 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55000)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <psainty@HIDDEN>) id 1VZ734-0005cu-S9
 for submit <at> debbugs.gnu.org; Wed, 23 Oct 2013 18:37:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1VZ72s-0004jy-DG
 for submit <at> debbugs.gnu.org; Wed, 23 Oct 2013 18:37:01 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:56387)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1VZ72s-0004ju-A3
 for submit <at> debbugs.gnu.org; Wed, 23 Oct 2013 18:36:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56713)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1VZ72m-0000Ob-1c
 for bug-gnu-emacs@HIDDEN; Wed, 23 Oct 2013 18:36:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1VZ72c-0004hE-Si
 for bug-gnu-emacs@HIDDEN; Wed, 23 Oct 2013 18:36:47 -0400
Received: from nctlincom01.orcon.net.nz ([60.234.4.69]:38559)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <psainty@HIDDEN>) id 1VZ72c-0004gW-BU
 for bug-gnu-emacs@HIDDEN; Wed, 23 Oct 2013 18:36:38 -0400
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 <bug-gnu-emacs@HIDDEN>; Thu, 24 Oct 2013 11:43:08 +1300
Received: from Debian-exim by mx5.orcon.net.nz with local (Exim 4.69)
 (envelope-from <psainty@HIDDEN>) id 1VZ72V-0003LF-OO
 for bug-gnu-emacs@HIDDEN; Thu, 24 Oct 2013 11:36:31 +1300
Received: from [172.16.100.200] (helo=mail.orcon.net.nz)
 by mx5.orcon.net.nz with esmtp (Exim 4.69)
 (envelope-from <psainty@HIDDEN>) id 1VZ72V-0003L7-L5
 for bug-gnu-emacs@HIDDEN; Thu, 24 Oct 2013 11:36:31 +1300
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)
Message-ID: <60659.202.78.240.7.1382567791.squirrel@HIDDEN>
Date: Thu, 24 Oct 2013 11:36:31 +1300 (NZDT)
Subject: 24.3; vc-git-annotate-command -- ambiguous short commit hashes cause 
 failures
From: "Phil Sainty" <psainty@HIDDEN>
To: bug-gnu-emacs@HIDDEN
User-Agent: SquirrelMail/1.4.5
MIME-Version: 1.0
Content-Type: text/plain;charset=iso-8859-1
Content-Transfer-Encoding: 8bit
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-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

`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:
<help-echo> M-x r e p o r t - e m <tab> <return>

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)






Acknowledgement sent to "Phil Sainty" <psainty@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#15696; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.