From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#65763: Error opening a file from a Git working directory if Git is not installed Date: Wed, 6 Sep 2023 17:31:05 +0300 Message-ID: <7fa60b9c-ae00-5fdd-4805-aa55cb4094e3@gutov.dev> References: <831qfc4d7h.fsf@gnu.org> <83y1hk2g29.fsf@gnu.org> <83a5tz33er.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23455"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Eli Zaretskii , 65763@debbugs.gnu.org To: Paul Pogonyshev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 06 16:32:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qdtZx-0005oL-8a for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Sep 2023 16:32:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdtZa-0002W8-Q6; Wed, 06 Sep 2023 10:32:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qdtZY-0002Vk-TW for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 10:32:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qdtZY-000523-LH for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 10:32:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdtZZ-0000o5-NU for bug-gnu-emacs@gnu.org; Wed, 06 Sep 2023 10:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Sep 2023 14:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65763 X-GNU-PR-Package: emacs Original-Received: via spool by 65763-submit@debbugs.gnu.org id=B65763.16940106793051 (code B ref 65763); Wed, 06 Sep 2023 14:32:01 +0000 Original-Received: (at 65763) by debbugs.gnu.org; 6 Sep 2023 14:31:19 +0000 Original-Received: from localhost ([127.0.0.1]:37116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdtYt-0000n8-0I for submit@debbugs.gnu.org; Wed, 06 Sep 2023 10:31:19 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:60997) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdtYr-0000mw-4X for 65763@debbugs.gnu.org; Wed, 06 Sep 2023 10:31:18 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EC15A5C00C1; Wed, 6 Sep 2023 10:31:09 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 06 Sep 2023 10:31:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694010669; x=1694097069; bh=oS4feDPh0NFmrHRbaZywfuWdnFAPDU7fmLB JgdpgtZ4=; b=k7zjYjpqE/J0XIaj5yab7PAHqNsjVtK4KEcTffqSk4Uihmalz4E L5JswONZuhZ5l/khK+AoxyypRYobOEUi8DGkAHFA/5ORuYbuvielnivn7YvAwmV7 xwh2QFC/xy55sWUmhCOjh/z8c+dGUMH+X/QVwFvxS8YAfmT3CYAdaT3yUlnoW07V l/GriZ3vgYCTLLNqJqYub9XGgT1jRj0vZGXDAph7agvLzEAMZtqeK4dyAr3Np3Xs A/BewxGRKdvZ56ELB/ktesCoA5J0uQiB4jfRlRFJqAaGOYnfzetf0Y+MyCZUAaX+ a7phLb+fYglw+iFazvfI2UKX18UiZ1rVNzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694010669; x=1694097069; bh=oS4feDPh0NFmrHRbaZywfuWdnFAPDU7fmLB JgdpgtZ4=; b=S4NFcX6wuW3kD7mM6s9HnF4jSiiAydAVGWx5RirsUyaAMAmLPsT YsSh/OxIoqVLmCdFfcDzide0BxBKJgbwGPku6qJqS4OEmnwNtu/uokxHnIYKVyjW 0AbMmTZo9piMaVDTuXA9OJjVW7hAL4g2P4RCHZ1A89T3aBDsD96EEBjpoGcLoZHY q6mnyuSRkG3NhY0s8lXiBe0pjWH9zXkMBohHcz+3hmIARLncFYqDQl0/2zssb3SF 2dUxWd6FyUKPHkdUhiERJPAixH+jn7F3FmE9rJQkydnkCPIQTexwSm7FIq47li2p +yBiVDOHSgqhpQzLicF1r+F3BzMCmpHTCAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehfedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnheptefffeekgffffffhfeetffeutddvudfgjeejffdugeetiedutefgffejfeeu geelnecuffhomhgrihhnpegrnhihthhhihhnghdrihhtnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Sep 2023 10:31:07 -0400 (EDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269549 Archived-At: On 06/09/2023 16:11, Paul Pogonyshev wrote: > Also consider this from a user point of view. Let's say I have nothing > to do with programming at all and don't have Git installed. Someone > emails me a cool Emacs package as a tarball and accidentally archives > `.git' along, because he is a developer. I unpack it, open some file and > now my Emacs warns me that Git is not installed. But why? I didn't even > ask it to do anything. It /itself/ decided to do something (because it > saw a `.git' directory), failed (Git is not installed), and now warns > /me/. From my point of view, if there is a failure for action that > wasn't direct result of user order, Emacs should stay silent. There was a previous discussion on this on the bug tracker which I can't find now. If someone is more able than me, it would be a welcome help. I think Lars was involved, and the general argument was that if .git is present, the user is plausibly interested in using our VC features and might not understand which programs might be needed to be installed for that to work. Or just forget about that aspect e.g. on a new machine. So we help them with those warnings. > In other words, I think there are two sane options here: > > 1) Simply check if Git is installed before doing anything Git-related > from `find-file-hook' callback. If it is not installed, just silently > don't do anything. Reserve errors and warnings until the user actually > ask you to do something Git-related, not simply to open a file. I don't mind this solution as well, and it has its logic. So if others like this approach we could do such change (roughly, we'd need to capture errors in all 'registered' functions at least, reraise as vc-backend-program-missing, and then catch them -- and only them -- silently at the top level).