From unknown Sat Jun 14 05:13:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15696: 24.3; vc-git-annotate-command -- ambiguous short commit hashes cause failures 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: To: 15696@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138256783121757 (code B ref -1); Wed, 23 Oct 2013 22:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Oct 2013 22:37:11 +0000 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 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 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 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 ) id 1VZ72s-0004ju-A3 for submit@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 ) id 1VZ72m-0000Ob-1c for bug-gnu-emacs@gnu.org; Wed, 23 Oct 2013 18:36:54 -0400 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 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 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 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 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 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@mail.orcon.net.nz> Date: Thu, 24 Oct 2013 11:36:31 +1300 (NZDT) From: "Phil Sainty" 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" 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: 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) From unknown Sat Jun 14 05:13:58 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15696: 24.3; vc-git-annotate-command -- ambiguous short commit hashes cause failures Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Dec 2020 15:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "Phil Sainty" Cc: 15696@debbugs.gnu.org Received: via spool by 15696-submit@debbugs.gnu.org id=B15696.160726788416762 (code B ref 15696); Sun, 06 Dec 2020 15:19:01 +0000 Received: (at 15696) by debbugs.gnu.org; 6 Dec 2020 15:18:04 +0000 Received: from localhost ([127.0.0.1]:50754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klvnX-0004MI-TJ for submit@debbugs.gnu.org; Sun, 06 Dec 2020 10:18:04 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klvnW-0004Li-NZ for 15696@debbugs.gnu.org; Sun, 06 Dec 2020 10:18:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ggGHDeZbZ3NVQTLhg1zc3ViazW8hSNGP4PmNQyIpJ3U=; b=NPxya8EN63hjBfFOVXP4VfVM0l x1KFLizubmk9YROfP2sqxschwRS4aBYdL0NVmQd3gJjV9hxLVORpUpYMVSFJorXe5bWuXbDbA06ou qmlUw9oUZKXpkNSci2DCwgpHUrEYsElv4MgvtOBi4DpCAPT7aZgzPhyOWF0j2AIe+k70=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klvnN-0005RV-9W; Sun, 06 Dec 2020 16:17:56 +0100 From: Lars Ingebrigtsen References: <60659.202.78.240.7.1382567791.squirrel@mail.orcon.net.nz> X-Now-Playing: Jacek Sienkiewicz's _Pres Rebooted_: "120 D-Rooms" Date: Sun, 06 Dec 2020 16:17:52 +0100 In-Reply-To: <60659.202.78.240.7.1382567791.squirrel@mail.orcon.net.nz> (Phil Sainty's message of "Thu, 24 Oct 2013 11:36:31 +1300 (NZDT)") Message-ID: <87mtyr9d5r.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: "Phil Sainty" writes: > `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" [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "Phil Sainty" writes: > `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: (This bug report unfortunately got no response at the time.) The command in question now produces an 11-char short hash, which I think is pretty rarely ambiguous, in my experience, so I don't think there's anything more to fix here, and I'm closing this bug report. If there's still a problem here, please respond to the debbugs address and we'll reopen. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 06 10:18:10 2020 Received: (at control) by debbugs.gnu.org; 6 Dec 2020 15:18:10 +0000 Received: from localhost ([127.0.0.1]:50757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klvne-0004Mg-4r for submit@debbugs.gnu.org; Sun, 06 Dec 2020 10:18:10 -0500 Received: from quimby.gnus.org ([95.216.78.240]:54126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1klvnc-0004MG-Io for control@debbugs.gnu.org; Sun, 06 Dec 2020 10:18:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=aPrJY6XMdNJivJNkl7eTApa2WZhU2OJSWEZcbDbewk4=; b=sSE6XRWMK6xxvVk9hw/mMyyF7z ANOmAY83VwSOQHbz4mzhJg+UCcHQSsCibuPyQAraJLXeC3DuPopmkun26d03hzZrAtX4iARl4q2P9 s1bl43ioz+UiDroPsdDuOp6EI6mxbhhYLL+BdATwfKNgwY7zO6QHj5LT9eT9gjxXKByo=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1klvnU-0005Re-SF for control@debbugs.gnu.org; Sun, 06 Dec 2020 16:18:03 +0100 Date: Sun, 06 Dec 2020 16:17:59 +0100 Message-Id: <87lfeb9d5k.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #15696 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 15696 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 15696 quit