简体   繁体   English

.emacs.d:我应该在elpa / archives下控制存档内容文件吗?

[英].emacs.d: should I version control the archive-contents files under elpa/archives?

I am not sure whether I should version control the following files under my .emacs.d : 我不确定是否应该在我的.emacs.d下版本控制以下文件:

[lucas@lucas-ThinkPad-W520]/home/lucas/.emacs.d$ file elpa/archives/marmalade/archive-con
tents                                                                                   
elpa/archives/marmalade/archive-contents: HTML document, UTF-8 Unicode text, with very lo
ng lines, with no line terminators                                                      
[lucas@lucas-ThinkPad-W520]/home/lucas/.emacs.d$ file elpa/archives/gnu/archive-contents
elpa/archives/gnu/archive-contents: ASCII text
[lucas@lucas-ThinkPad-W520]/home/lucas/.emacs.d$ 

As shown above, marmalade/archive-contents is an HTML document while gnu/archive-contents is ASCII text. 如上所示, marmalade/archive-contents是一个HTML文档,而gnu/archive-contents是ASCII文本。 Are these safe to include in my version control or should I remove them from my index? 这些安全包含在我的版本控制中还是应该从索引中删除?

For example, I use emacs across different platforms like Ubuntu Linux and Windows 7, and I would like to keep my emacs environment consistent. 例如,我在不同的平台上使用emacs,比如Ubuntu Linux和Windows 7,我希望我的emacs环境保持一致。 It works so far, but I want to avoid future problems. 它到目前为止工作,但我想避免未来的问题。 I am ignoring files like *.elc , but I don't know whether archive-contents under version control will help or hinder my cross-platform emacs environment. 我忽略了像*.elc这样的文件,但我不知道版本控制下的archive-contents是否有助于或阻碍我的跨平台emacs环境。

I looked at other .emacs.d/ repositories, like this one , and examined their .gitignore files, but I don't know if they are doing correctly either. 我查看了其他.emacs.d/ repositories,就像这个一样,检查了他们的.gitignore文件,但我不知道他们是否也正确。 Any suggestions or resources on how to manage the .emacs.d/ version control for cross-platform development would be great. 有关如何管理.emacs.d/版本控制以进行跨平台开发的任何建议或资源都会很棒。

Here is my current .gitignore : 这是我目前的.gitignore

*~
*.elc
tramp

Update This seems to be an iffy topic, but it seems that the significant majority do not version control their entire elpa/ folder even though it may take a hit on their initial load time (immediately after cloning). 更新这似乎是一个不确定的话题,但似乎绝大多数都没有版本控制他们的整个elpa/文件夹,即使它可能会受到初始加载时间的影响(克隆后立即)。 I think I will follow that advice, and I'm willing to live with it rather than spending more time managing the extra issues of a pre-compiled repository. 我想我会遵循这个建议,我愿意接受它,而不是花更多的时间来管理预编译存储库的额外问题。

I do not commit .emacs.d/elpa at all. 我根本没有提交.emacs.d/elpa My init.el automatically reinstalls missing packages on startup. 我的init.el在启动时自动重新安装缺少的软件包。 I did not have any issues yet, even though I exclusively use unstable packages from MELPA. 我没有任何问题,即使我专门使用MELPA的不稳定包。

I don't think including archive-contents should cause any problems. 我不认为包含archive-contents会导致任何问题。 I don't make much use of package.el, but I have that file in my repo, and haven't noticed any issues. 我没有太多使用package.el,但我在我的仓库中有这个文件,并没有发现任何问题。

Byte-compiled .elc files are portable. 字节编译的.elc文件是可移植的。 I recommend that you do include them in your repository, otherwise you risk ending up with uncompiled elisp when you clone your repo, and Emacs will run your config awfully slowly. 我建议你它们包括在库中,否则你可能会与未编译elisp的,当你克隆你的回购结束了,和Emacs将运行配置非常慢。

Remember that none of the default recompilation commands will compile a .el file if it doesn't already have a .elc file, so you'd be left needing to decide whether or not it was valid to forcibly compile everything (which isn't necessarily a safe thing to do), or manually pick and choose. 请记住,没有默认的重新编译的命令将编译.el文件,如果它不已经有一个.elc文件,所以你会留到需要决定它是否是有效的强制编译一切 (这是不必须是安全的事情),或手动挑选。 Neither is a good option. 两者都不是一个好选择。

The exceptions I make are for the elisp files which I edit myself (init file, etc) as there's more chance of causing problems when you're editing files in multiple places, and merging. 我做的例外是我自己编辑的elisp文件(init文件等),因为当您在多个位置编辑文件和合并时,更有可能导致问题。 So I do .gitignore these files (and forcibly compile them for new deployments). 所以我 .gitignore这些文件(并强制编译它们用于新部署)。 However I use http://tarsius.github.com/auto-compile ( Highly recommended) to automatically ensure that the compiled versions of these (and indeed all) .elc files is always up to date, so that when I merge the modified .el files, Emacs won't load the outdated .elc file instead. 但是,我使用http://tarsius.github.com/auto-compile强烈推荐)自动确保这些(实际上所有).elc文件的编译版本始终是最新的,这样当我合并修改后.el文件,Emacs不会加载过时的.elc文件。

FWIW my .gitignore looks like this (although some of the names are custom). FWIW我的.gitignore看起来像这样(虽然有些名字是自定义的)。 It's pretty much a case of adding stuff as you encounter a need for it, though, so I wouldn't suggest that you copy this. 但是,当你遇到需要它时,这几乎是一个添加东西的情况,所以我不建议你复制它。

*~
/auto-save-list/
/backup/
/bookmarks.bmk
/desktop/*
/eshell/*
/history
/server/
/tramp
/geben/
/erc/*
/image-dired/
/url
session.*
/my-lisp/*.elc

These files are created by package.el (more specific, the package-update-contents function), and contain the index of packages for each ELPA repository. 这些文件由package.el (更具体地, package-update-contents函数)创建,并包含每个ELPA存储库的包索引。 Checking them into VC might be annoying because they get updated frequently and you have to deal with merge, which is meaningless since they will be updated by package.el eventually. 将它们检入VC可能会很烦人,因为它们经常更新,你必须处理合并,这是没有意义的,因为它们最终会被package.el更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM