I have the entire elpa directory added into a git repository so that I always have a known good setup that I can fall back on. This works well when I am cloning it in linux machines but when I clone it in windows machines, it doesn’t work.
I have removed all the .elc files since those are not cross compatible but it still didn’t work and I realise that it’s because the generated autoload file is specified to be using unix style line endings (LF) but when I cloned it in the windows machine, the autoload files will have dos style line endings (CRLF) therefore causing the issue.
Interestingly, the init file also uses CRLF and it still works presumably because it does not have the same specified coding as the generated autoload files.
How should I get around this problem? I’m thinking of setting core.autocrlf to false on my windows machine. While that works, I will have to remember to create new files in my .emacs.d with only LF to keep the git repo clean and also presumably for it to work. I also thought about regenerating those autoloads after a clone but I’m not sure how to do so. Hence, I’m looking to see whether others have better solutions to this problem.
Edit: I realise I can set core.autocrlf to input so that git will automatically convert any CRLF to LF on commit therefore resolving the issue. Regardless, I am still interested to hear from the others who version control their elpa directory on what is their strategy.
Probably not what you want to do, but IIUC you could run Emacs from Cygwin and it wouldn’t have that problem.
I started to play with that to store the eln files on the vc and create a “binary only” emacs …
I don’t know it is theoretically possible or not (to use the eln files without el ones).config --global core.autocrlf true
Change to
straight.el
package manager, it downloads git repos you can lock and even add your own.I only have my
.emacs
file under version control, which automatically installs missing packages throughuse-package
’s:ensure
parameter.The downside is of course that it takes a while after a fresh checkout.