GNU bug report logs - #51460
emacs-magit: path error during commit

Previous Next

Package: guix;

Reported by: Christopher Howard <christopher <at> librehacker.com>

Date: Thu, 28 Oct 2021 14:25:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51460 in the body.
You can then email your comments to 51460 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#51460; Package guix. (Thu, 28 Oct 2021 14:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christopher Howard <christopher <at> librehacker.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 28 Oct 2021 14:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Howard <christopher <at> librehacker.com>
To: Guix Bug Reports <bug-guix <at> gnu.org>
Subject: emacs-magit: path error during commit
Date: Thu, 28 Oct 2021 06:24:30 -0800
Hello, for a long time I've struggled with getting a path error when I
try to do a commit using emacs-magit. Here is an example log copied from
the magit-process buffer:

```
  0 git … add -u -- Genesis/gen_1.org
  1 git … commit --
hint: Waiting for your editor to close the file...
Waiting for Emacs...
*ERROR*: Searching for program: No such file or directory, git
error: There was a problem with the editor
'/gnu/store/dpky3z5844bclhswdk69z90vayy65b58-emacs-27.2/bin/emacsclient
--socket-name=/run/user/1000/emacs/server'.
Please supply the message using either -m or -F option.
```

I find this confusing because
- I can use magit to stage my commits
- In the Magit Group (M-x customize-group magit), the Magit Git
Executable is set to /home/christopher/.guix-profile/bin/git, and that
file does exist in my profile.
- /gnu/store/dpky3z5844bclhswdk69z90vayy65b58-emacs-27.2/bin/emacsclient 
also does exist
- Within emacs, I can run the shell command M-! git commit or M-! git
commit -m "..." and this works fine.

I suspect that emacs-magit might not be properly using the Magit Git
Executable path for this action, but haven't had a chance to look at the
source code yet. Probably this should be submitted as an issue or
support request to emacs-magit, but I have not done so since (on
principle) I do not have a github account, or use google groups.

Here is my system information;

```
christopher <at> nightshade ~$ neofetch --stdout
christopher <at> nightshade 
---------------------- 
OS: Guix System 9aaf402a379b9ac9e4c3eee5b16f7496d7606e91 x86_64 
Host: GA-880GM-UD2H 
Kernel: 5.14.9-gnu 
Uptime: 1 hour, 20 mins 
Packages: 61 (guix-system), 155 (guix-user) 
Shell: bash 5.0.16 
Resolution: 1920x1200 
DE: GNOME 3.34.5 
Theme: Adwaita [GTK2/3] 
Icons: Adwaita [GTK2/3] 
Terminal: .gnome-terminal 
CPU: AMD Athlon II X3 455 (3) @ 3.300GHz 
GPU: NVIDIA GeForce 8400 GS Rev. 3 
Memory: 1338MiB / 7893MiB 
```

-- 
Christopher Howard
Gemini capsule: gemini://gem.librehacker.com
Web version: https://portal.mozz.us/gemini/gem.librehacker.com






Information forwarded to bug-guix <at> gnu.org:
bug#51460; Package guix. (Sat, 26 Feb 2022 22:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 51460 <at> debbugs.gnu.org (full text, mbox):

From: Kyle Meyer <kyle <at> kyleam.com>
To: Christopher Howard <christopher <at> librehacker.com>
Cc: 51460 <at> debbugs.gnu.org
Subject: Re: bug#51460: emacs-magit: path error during commit
Date: Sat, 26 Feb 2022 17:54:29 -0500
Hello,

I came across this bug report when searching for something else.  In
case it helps...

Christopher Howard writes:

> Hello, for a long time I've struggled with getting a path error when I
> try to do a commit using emacs-magit. Here is an example log copied from
> the magit-process buffer:
>
> ```
>   0 git … add -u -- Genesis/gen_1.org
>   1 git … commit --
> hint: Waiting for your editor to close the file...
> Waiting for Emacs...
> *ERROR*: Searching for program: No such file or directory, git
> error: There was a problem with the editor
> '/gnu/store/dpky3z5844bclhswdk69z90vayy65b58-emacs-27.2/bin/emacsclient
> --socket-name=/run/user/1000/emacs/server'.
> Please supply the message using either -m or -F option.
> ```

In Magit v3.3.0 and earlier, this error matches what you would see if
"git" isn't in $PATH for the editor that pops up.  This is true even
when magit-git-executable points to an executable.

In the development version of Magit, this should no longer happen as of
77255776 (git-commit: Use magit-git-executable function if available,
2022-02-21).  The issue that prompted that is
<https://github.com/magit/with-editor/issues/106>.  (I know that below
you say you don't use GitHub, but for others that may find that useful.)

(Based on what you say below, it sounds like "git" should be in $PATH,
so things aren't quite adding up still.)

> I find this confusing because
> - I can use magit to stage my commits
> - In the Magit Group (M-x customize-group magit), the Magit Git
> Executable is set to /home/christopher/.guix-profile/bin/git, and that
> file does exist in my profile.
> - /gnu/store/dpky3z5844bclhswdk69z90vayy65b58-emacs-27.2/bin/emacsclient 
> also does exist

Yes, staging and most of things in Magit respect magit-git-executable.
As I mention above and you suspect in the quoted text below, that value
wasn't consulted by the code path relevant for the error above (in
git-commit.el).

> - Within emacs, I can run the shell command M-! git commit or M-! git
> commit -m "..." and this works fine.

Hmm, so your main Emacs session has "git" on its exec-path.  Perhaps
there's something going on with the with-editor launched editor.  I'd
suggest looking at with-editor-debug and seeing if
/home/christopher/.guix-profile/bin is in the path it reports.

> I suspect that emacs-magit might not be properly using the Magit Git
> Executable path for this action, but haven't had a chance to look at the
> source code yet.

Yep, that's it, and, as I mentioned above, should be fixed by 77255776
(git-commit: Use magit-git-executable function if available,
2022-02-21).




Information forwarded to bug-guix <at> gnu.org:
bug#51460; Package guix. (Tue, 12 Jul 2022 14:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 51460 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Christopher Howard <christopher <at> librehacker.com>
Cc: 51460 <at> debbugs.gnu.org
Subject: Re: bug#51460: emacs-magit: path error during commit
Date: Tue, 12 Jul 2022 10:23:57 -0400
Hi Christopher,

Christopher Howard <christopher <at> librehacker.com> writes:

> Hello, for a long time I've struggled with getting a path error when I
> try to do a commit using emacs-magit. Here is an example log copied from
> the magit-process buffer:
>
> ```
>   0 git … add -u -- Genesis/gen_1.org
>   1 git … commit --
> hint: Waiting for your editor to close the file...
> Waiting for Emacs...
> *ERROR*: Searching for program: No such file or directory, git
> error: There was a problem with the editor
> '/gnu/store/dpky3z5844bclhswdk69z90vayy65b58-emacs-27.2/bin/emacsclient
> --socket-name=/run/user/1000/emacs/server'.
> Please supply the message using either -m or -F option.
> ```

One thing I can think about is that emacs-magit doesn't refer to git
directly:

$ guix gc -R /gnu/store/xd1bvmac1p4gjxb90m875r15xna52jyr-emacs-magit-3.3.0
/gnu/store/720rj90bch716isd8z7lcwrnvz28ap4y-bash-static-5.1.8
/gnu/store/vqdsrvs9jbn0ix2a58s99jwkh74124y5-coreutils-minimal-8.32
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33
/gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8
/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib
/gnu/store/hy6abswwv4d89zp464fw52z65fkzr7h5-perl-5.34.0
/gnu/store/xd1bvmac1p4gjxb90m875r15xna52jyr-emacs-magit-3.3.0

So it needs to be on your PATH.  For me, the value returned by 'C-h v
magit-git-executable' is "git".  One thing we could do is patch the
default value of this Elisp variable in our emacs-magit package to git,
so that users wouldn't need installing git manually.

Thanks,

Maxim




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Wed, 04 Oct 2023 03:26:01 GMT) Full text and rfc822 format available.

Notification sent to Christopher Howard <christopher <at> librehacker.com>:
bug acknowledged by developer. (Wed, 04 Oct 2023 03:26:02 GMT) Full text and rfc822 format available.

Message #16 received at 51460-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Christopher Howard <christopher <at> librehacker.com>
Cc: 51460-done <at> debbugs.gnu.org
Subject: Re: bug#51460: emacs-magit: path error during commit
Date: Tue, 03 Oct 2023 23:24:37 -0400
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> Hi Christopher,
>
> Christopher Howard <christopher <at> librehacker.com> writes:
>
>> Hello, for a long time I've struggled with getting a path error when I
>> try to do a commit using emacs-magit. Here is an example log copied from
>> the magit-process buffer:
>>
>> ```
>>   0 git … add -u -- Genesis/gen_1.org
>>   1 git … commit --
>> hint: Waiting for your editor to close the file...
>> Waiting for Emacs...
>> *ERROR*: Searching for program: No such file or directory, git
>> error: There was a problem with the editor
>> '/gnu/store/dpky3z5844bclhswdk69z90vayy65b58-emacs-27.2/bin/emacsclient
>> --socket-name=/run/user/1000/emacs/server'.
>> Please supply the message using either -m or -F option.
>> ```
>
> One thing I can think about is that emacs-magit doesn't refer to git
> directly:
>
> $ guix gc -R /gnu/store/xd1bvmac1p4gjxb90m875r15xna52jyr-emacs-magit-3.3.0
> /gnu/store/720rj90bch716isd8z7lcwrnvz28ap4y-bash-static-5.1.8
> /gnu/store/vqdsrvs9jbn0ix2a58s99jwkh74124y5-coreutils-minimal-8.32
> /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33
> /gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8
> /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib
> /gnu/store/hy6abswwv4d89zp464fw52z65fkzr7h5-perl-5.34.0
> /gnu/store/xd1bvmac1p4gjxb90m875r15xna52jyr-emacs-magit-3.3.0
>
> So it needs to be on your PATH.  For me, the value returned by 'C-h v
> magit-git-executable' is "git".  One thing we could do is patch the
> default value of this Elisp variable in our emacs-magit package to git,
> so that users wouldn't need installing git manually.

Commit b59b033af3957e0de9a44733e26cbcc7114a4dfb ("gnu: emacs-magit:
Substitute git executable path.") should prevent such a situation from
occurring.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 01 Nov 2023 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 177 days ago.

Previous Next


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