Fix invalid submodule error when using straight.el

Table of Contents

My ordinary workflow was to start emacs with a load into my orgmode agenda, which locates me in my .emacs git-project. Upon inspecting my agenda I’ll go to some project from my todo list using helm-projectile. However, after switching to Staight.el (which does its heavy lifting with git) this workflow was broken. The result is that, when I try to use projectile from somewhere that Git includes Straight stuff, I get this failure about submodules:

In ‘Projectile files’ source: ‘#[0 \301 \205;r\302!\203\206p\211q\210\303 \304 \305\211:\2036@\262\306"BB\262A\262\202\211\237\266\204)\207 [helm-current-buffer projectile-project-p buffer-live-p projectile-project-root projectile-current-project-files nil expand-file-name] 8]’ (file-missing “Setting current directory” “No such file or directory” “home/justme/emacs/fatal: No url found for submodule path ’.emacs.d/straight/repos/a.el’ in .gitmodules .emacs.d/counsel-bbdb")

If I try to add a URL for that repo by hand, I just get the same error for another submodule, and another, and …

Answer

This is solved byn making sure the straight repos – which are git repos – are not included in your overall setup that is watching git for everything. The following command took are of the problem for me (adjust the path as you need):

git rm -r --cached ./.emacs.d/straight/repos

Resources

https://github.com/raxod502/straight.el/issues/567

Tory Anderson avatar
Tory Anderson
Full-time Web App Engineer, Digital Humanist, Researcher, Computer Psychologist