Package: elpa-magit
Version: 4.1.3-1
Severity: normal
Tags: upstream

Dear Maintainer,


After loading git-commit.el without loading magit.el, `git-commit-setup' fails.
To reproduce, try:

    $ emacs -q --eval="(require 'git-commit)" \
            COMMIT_EDITMSG

Note the error message in the echo area "Symbol's function definition is void:
magit-process-git", and that the Emacs frame is not displaying the
COMMIT_EDITMSG buffer.  After switching to the COMMIT_EDITMSG buffer, observe
that it is in `fundamental-mode'.
Compare that to:

    $ emacs -q --eval="(progn (require 'git-commit) (require 'magit-process))" \
            COMMIT_EDITMSG

Now, the Emacs frame displays the COMMIT_EDITMSG buffer in `text-mode' with all
the niceties of `git-commit-setup' activated (observe e.g. the different
fontification of the first (summary), second (empty) and third (body) line).

The failure occurs as `git-commit-setup' invokes `magit-toplevel', which invokes
`magit-rev-parse-safe', which invokes `magit-git-str', which invokes
`magit-process-git', which is defined in magit-process.el which has at no point
been loaded.
There should probably be a "(require 'magit-process)" in one of these files
(maybe within the `git-commit-setup' function itself, to keep load times of the
non-autoloadable git-commit.el short), or an `autoload' annotation on
`magit-process-git'.


The documentation for `global-git-commit-mode' states:

    You can either rely on `magit' loading this library or
    you can load it explicitly.

So loading git-commit.el without loading magit.el (which would load
magit-process.el) should be supported.  My usecase for that is using the
features provided by `git-commit-setup' when the Git CLI invokes Emacs (or
Emacsclient) as its $EDITOR.  For that I have only "(require 'git-commit)" in my
init.el, while the rest of Magit is autoloaded only when it's actually used.


I'm reporting this to the debian package instead of upstream, as I think this
occurs since about the time the elpa-magit and elpa-git-commit packages were
merged.  I do think it's just an upstream bug, but am not 100 % sure.



Yours
Timon



-- System Information:
Debian Release: trixie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.5-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages elpa-magit depends on:
ii  dh-elpa-helper      2.1.5
ii  elpa-compat         30.0.1.0+dfsg-1
ii  elpa-dash           2.19.1+git20240510.1de9dcb+dfsg-1
ii  elpa-magit-section  4.1.3-1
ii  elpa-seq            2.24-2
ii  elpa-transient      0.8.1-1
ii  elpa-with-editor    3.4.3-1
ii  emacsen-common      3.0.5
ii  git                 1:2.45.2-1.2

elpa-magit recommends no packages.

elpa-magit suggests no packages.

-- no debconf information

Reply via email to