有没有一种简单的方法可以将 Emacs 编号的软件版本转换为 git 版本?
我有一些来自开源项目的文件,我对其进行了一些编辑,例如,
Makefile
Makefile.~1~
Makefile.~2~
这些编号版本是由 Emacs 及其编号版本控制创建的,就像 VMS 版本化文件
我了解 Linux 项目和 Perl 语言项目回顾性地将其最旧的版本放在版本下控制。我想将 .tar.gz tarball 文件中未解压的文件和编号版本追溯添加到版本控制系统中。
有没有相对容易或简单的方法来做这样的事情?我将如何编写脚本来自动化此过程?
I have some files from an open source project which I edited somewhat, e.g.
Makefile
Makefile.~1~
Makefile.~2~
These numbered versions are made by Emacs with its numbered version control and are like VMS versioned files
I understand that the Linux project and Perl language project retrospectively put their oldest versions under version control. I would like to retrospectively add the files as untarred from the .tar.gz tarball file and the numbered versions into a version-controlled system.
Is there any relatively easy or simple way to do such a thing? How would I go about writing a script to automate this process?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我要冒险假设您的编号文件全部匹配 - 即
foo.~3~
和bar.~3~
是来自相同的整体版本。如果不是,我不明白你怎么可能有足够的信息来构建有意义的历史。当然,我们还假设所有这些编号的文件都在一个目录中,可能包含在您提到的 tarball 中。以下内容并不完全完美,但它确实适用于我的测试用例。 (它无法正确处理一个版本中存在但下一版本中不存在的隐藏文件 - 如果您关心的话,请将 rm -rf * 更改为更闪亮的内容。)
Okay, I'm going to go out on a limb here and assume that your numbered files all match up - i.e.
foo.~3~
andbar.~3~
are from the same overall version. If they aren't, I don't see how you possibly have enough information to construct a meaningful history. And of course, let's also assume all these numbered files are in one directory, possibly bottled up in that tarball that you mention.The following isn't totally perfect, but it certainly worked on my test case. (It doesn't properly deal with hidden files which exist in one version but not the next - change that
rm -rf *
to something shinier if you care about that.)