this post was submitted on 31 Oct 2023
2 points (100.0% liked)

Emacs

311 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] github-alphapapa@alien.top 1 points 1 year ago

Probably not what you want to do, but IIUC you could run Emacs from Cygwin and it wouldn't have that problem.