From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.bugs Subject: bug#65763: Error opening a file from a Git working directory if Git is not installed Date: Tue, 5 Sep 2023 22:06:01 +0200 Message-ID: References: <831qfc4d7h.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000a0da710604a2283b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65763@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 05 22:07:16 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 1qdcKR-0006dY-SK for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Sep 2023 22:07:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdcKG-0002S7-7g; Tue, 05 Sep 2023 16:07:04 -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 1qdcKE-0002QS-Ar for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 16:07:02 -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 1qdcKE-0001xG-2x for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 16:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdcKE-0005en-Gt for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 16:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Pogonyshev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Sep 2023 20:07:02 +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.169394438521695 (code B ref 65763); Tue, 05 Sep 2023 20:07:02 +0000 Original-Received: (at 65763) by debbugs.gnu.org; 5 Sep 2023 20:06:25 +0000 Original-Received: from localhost ([127.0.0.1]:59512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdcJd-0005do-95 for submit@debbugs.gnu.org; Tue, 05 Sep 2023 16:06:25 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:51488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdcJZ-0005dZ-Fl for 65763@debbugs.gnu.org; Tue, 05 Sep 2023 16:06:24 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50079d148aeso4915989e87.3 for <65763@debbugs.gnu.org>; Tue, 05 Sep 2023 13:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693944373; x=1694549173; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/lUWsAiXJmlz/30xhW0c2CNvCnvvYP1FcvK7BWdGS7Q=; b=AH13Sbg00o32ihSHPkwddk+X8/tNjI4Xtw8mCpjLl/h/pwNVX6tubByAfNvMDW6obZ FcK4I52s+gLPGUqk8iVcKk/QEnbYohS9qIhcPZPGtCYBUDCf/8tCObmU1Yt8CH5MFoov qEFd35NXUplVQ+b1Y75cAKutt8e9jQl85nkmOaPGie6xYH3AeCOp25natUjTwIy/FnGf kxvkMpyeaJJFDS9ecfrAZuYBCOITc+pW6Tdc87HPX+wolnxrsEGM/XM3thPOEy0Gr5sh jG0w6LBVrmcViLwAzjZERTrpfwTXD5elvKzR5Q1oAbjt3SzUKccsPX7KvnCSA7ndFS0y qBkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693944373; x=1694549173; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/lUWsAiXJmlz/30xhW0c2CNvCnvvYP1FcvK7BWdGS7Q=; b=aRgcDp5FabDGm89/UQEzWWLsYu9QU0uy4ZWeXl6prVrhVuN4G+fvim0U+zTrJPKwEJ +DyJNPa6gzay9oyBAZpHc/XgyfYEppyGKeNmJgem/boSWHYnTFMnrVY/IIXfmMeKMBMe Nl7q/ObJWc+Xzor6olhzmwSAVOI756XIWphM7ETNzXXQYsIiIGIRK7eWuF9OJVG2IVFp DLHs3+VUI5GlEoCsVvMKDaBZWv60gS7xXAypPIKYbIXr2KqM+IQsELeXxpk+yWhxXZPs n5Aul7GLbuaaolzJXKMxJh6hwr2RxrXqKhxIJMCAjGpwG0Xn5ecdPrYBw35U7sE1/g5/ XnLA== X-Gm-Message-State: AOJu0Yys3zlPfka/xWLrKMa+mx0YXnd3w/DtsrjWfnZCqb1GdBUA9+d6 iIjJJga1gz9lDQcQTMUSJU2dbghePED1NNUxS2mDK1wU/Q== X-Google-Smtp-Source: AGHT+IGSYl0K+J+PNeg9/coNrWjp63/f575ry+xTSpC09UkVNHtP1Nlcok1qnxzeO1gr+fn4atDF9M7ad0/PxDDjNvk= X-Received: by 2002:ac2:58ce:0:b0:500:953b:d112 with SMTP id u14-20020ac258ce000000b00500953bd112mr553678lfo.27.1693944373105; Tue, 05 Sep 2023 13:06:13 -0700 (PDT) In-Reply-To: <831qfc4d7h.fsf@gnu.org> 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:269400 Archived-At: --000000000000a0da710604a2283b Content-Type: text/plain; charset="UTF-8" >From what I see it's not just a warning: $ emacs --batch --eval "(let ((debug-on-error t)) (setf vc-git-program \"git-is-not-installed\") (find-file-noselect \"whatever\"))" Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "git-is-not-installed") call-process("git-is-not-installed" nil (t nil) nil "--no-pager" "ls-files" "-c" "-z" "--" "whatever") process-file("git-is-not-installed" nil (t nil) nil "--no-pager" "ls-files" "-c" "-z" "--" "whatever") vc-git--call((t nil) "ls-files" "-c" "-z" "--" "whatever") vc-git--out-ok("ls-files" "-c" "-z" "--" "whatever") vc-git-registered("/home/paul/eldev/whatever") vc-git-registered("/home/paul/eldev/whatever") vc-call-backend(Git registered "/home/paul/eldev/whatever") #f(compiled-function (b) #)(Git) mapc(#f(compiled-function (b) #) (RCS CVS SVN SCCS SRC Bzr Git Hg)) vc-registered("/home/paul/eldev/whatever") vc-backend("/home/paul/eldev/whatever") vc-refresh-state() run-hooks(find-file-hook) after-find-file(t t) find-file-noselect-1(# "~/eldev/whatever" nil nil "~/eldev/whatever" nil) find-file-noselect("whatever") (let ((debug-on-error t)) (setf vc-git-program "git-is-not-installed") (find-file-noselect "whatever")) command-line-1(("--eval" "(let ((debug-on-error t)) (setf vc-git-program \"gi...")) command-line() normal-top-level() Paul On Tue, 5 Sept 2023 at 21:44, Eli Zaretskii wrote: > > From: Paul Pogonyshev > > Date: Tue, 5 Sep 2023 20:54:54 +0200 > > > > To reproduce: > > > > 1. Change current directory to a Git checkout (e.g. `~/git/emacs' or > something). > > 2. From the command line: > > > > $ emacs --batch --eval "(progn (setf vc-git-program > \"git-is-not-installed\") (find-file-noselect > > \"whatever\"))" > > Error: (file-missing "Searching for program" "No such file or > directory" "git-is-not-installed") > > > > Expected: Emacs is able to open the file, Git must not be essential. > > Emacs does open the file; what you see is not an error, it's a > message. The code which tries to invoke Git runs with-demoted-errors, > so any error is converted to a simple message. If you try this > variant of your command: > > $ emacs --batch --eval "(progn (setf vc-git-program > \"git-is-not-installed\") (message \"%s\" (find-file-noselect \"README\")))" > > you will see: > > Error: (file-missing "Searching for program" "No such file or directory" > "git-is-not-installed") > README > > That "README" at the end means that find-file-noselect did read the > file into its buffer, and the error message is just a message. > > So if this somehow prevented you from doing something, please tell > more, or maybe the recipe needs more steps? > --000000000000a0da710604a2283b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
From what I see it's not just a warning:

$ emacs --batch --eval "(let ((debug-on-error t)) (setf vc= -git-program \"git-is-not-installed\") (find-file-noselect \"= ;whatever\"))"
Debugger entered--Lisp error: (file-missing &qu= ot;Searching for program" "No such file or directory" "= git-is-not-installed")
=C2=A0 call-process("git-is-not-install= ed" nil (t nil) nil "--no-pager" "ls-files" "= -c" "-z" "--" "whatever")
=C2=A0 proc= ess-file("git-is-not-installed" nil (t nil) nil "--no-pager&= quot; "ls-files" "-c" "-z" "--" &qu= ot;whatever")
=C2=A0 vc-git--call((t nil) "ls-files" &quo= t;-c" "-z" "--" "whatever")
=C2=A0 vc= -git--out-ok("ls-files" "-c" "-z" "--&qu= ot; "whatever")
=C2=A0 vc-git-registered("/home/paul/elde= v/whatever")
=C2=A0 vc-git-registered("/home/paul/eldev/whatev= er")
=C2=A0 vc-call-backend(Git registered "/home/paul/eldev/w= hatever")
=C2=A0 #f(compiled-function (b) #<bytecode 0x15a622e46= 2a366fe>)(Git)
=C2=A0 mapc(#f(compiled-function (b) #<bytecode 0x1= 5a622e462a366fe>) (RCS CVS SVN SCCS SRC Bzr Git Hg))
=C2=A0 vc-regist= ered("/home/paul/eldev/whatever")
=C2=A0 vc-backend("/hom= e/paul/eldev/whatever")
=C2=A0 vc-refresh-state()
=C2=A0 run-hoo= ks(find-file-hook)
=C2=A0 after-find-file(t t)
=C2=A0 find-file-nosel= ect-1(#<buffer whatever> "~/eldev/whatever" nil nil "~= /eldev/whatever" nil)
=C2=A0 find-file-noselect("whatever"= ;)
=C2=A0 (let ((debug-on-error t)) (setf vc-git-program "git-is-no= t-installed") (find-file-noselect "whatever"))
=C2=A0 com= mand-line-1(("--eval" "(let ((debug-on-error t)) (setf vc-gi= t-program \"gi..."))
=C2=A0 command-line()
=C2=A0 normal-to= p-level()

Paul

On Tue, 5 Sept 2023 at 21:44, El= i Zaretskii <eliz@gnu.org> wrote:=
> From: Paul= Pogonyshev <p= ogonyshev@gmail.com>
> Date: Tue, 5 Sep 2023 20:54:54 +0200
>
> To reproduce:
>
> 1. Change current directory to a Git checkout (e.g. `~/git/emacs' = or something).
> 2. From the command line:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 $ emacs --batch --eval "(progn (setf v= c-git-program \"git-is-not-installed\") (find-file-noselect
> \"whatever\"))"
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 Error: (file-missing "Searching for pr= ogram" "No such file or directory" "git-is-not-installe= d")
>
> Expected: Emacs is able to open the file, Git must not be essential.
Emacs does open the file; what you see is not an error, it's a
message.=C2=A0 The code which tries to invoke Git runs with-demoted-errors,=
so any error is converted to a simple message.=C2=A0 If you try this
variant of your command:

=C2=A0 $ emacs --batch --eval "(progn (setf vc-git-program \"git-= is-not-installed\") (message \"%s\" (find-file-noselect \&qu= ot;README\")))"

you will see:

=C2=A0 Error: (file-missing "Searching for program" "No such= file or directory" "git-is-not-installed")
=C2=A0 README

That "README" at the end means that find-file-noselect did read t= he
file into its buffer, and the error message is just a message.

So if this somehow prevented you from doing something, please tell
more, or maybe the recipe needs more steps?
--000000000000a0da710604a2283b--