丢失修订项目的 SVN 最佳实践
历史: 我被要求编辑一些代码。问题是没有人能找到我们正在运行的代码。到目前为止,我们得到的最接近的是一个 jar(仅包含 .class 文件)。我尝试用JAD反编译,但遇到了问题。然后我尝试使用 JADRetro 然后 JAD 进行反编译(这效果更好,到目前为止我只看到一个问题......但我仍然担心代码的准确性)。 为了将来的工作,我想将“代码”放入 SVN 中。但我想知道如何最好地做到这一点。我有这个反编译的代码(缺少所有注释,质量未知)并且我有更早版本的实际源代码(我们实际上没有运行)。
问题: 考虑到一个版本是带有注释的良好原始源代码,但相当旧(而且不是我们正在运行的版本),我如何最好地将代码放入 SVN 中?另一个版本无法正确重新编译(因为至少有一个反编译错误)并且缺少任何注释(正在反编译),但这是我们正在运行的版本(某种程度上,因为它没有正确反编译)。
我可以签入原始代码,但是如何签入“下一个版本”(这是后来反编译的代码,并且有很多更改(添加类、更改代码、重命名类、移动类......) ))。如果我签入第一个版本,然后删除所有内容并签入下一个版本(因为我没有对这两个版本中的任何一个进行编码),我担心这会混淆/损坏 SVN。处理此类法医修订的最佳方法是什么?
History:
I was asked to edit some code. Problem is no one can find the code we're running. So far the closest we got was a jar (containing only .class files). I tried decompiling with JAD and had problems. Then I tried decompiling with JADRetro then JAD (this worked better, so far I only see one problem... but I still worry about how accurate the code is).
For future efforts I'd like to put the "code" into SVN. But I'm wondering how best to do it. I have this decompiled code (missing all comments, of unknown quality) AND I have actual source code of a much earlier version (which we aren't actually running).
Question:
How best would I put code into SVN given that one version is good pristine source with comments, but is rather old (and not what we're running); and another version which doesn't recompile correctly (because of at least one decompilation error) and lacks any comments (being decompiled) but is what we are running (sort of, since it didn't decompile correctly).
I can check in the pristine code, but then how do I check in the "next version" (which is decompiled code from a later point and has LOTS of changes (classes added, code changed, classes renamed, classes moved....)). If I check the first version in, then delete everything and check the next version in (because I'm not coding either of these versions) I worry that this will confuse/corrupt SVN. What is the best approach for dealing with forensic revisions like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好将反编译代码签入为“下一个版本”。是的,会有很多变化,但无论如何都会有很多变化。
然而,SVN 将包含整个项目历史。是的,历史会有间隙,但无论如何,SVN是用来追踪历史的。因此删除旧版本并从头开始不是一个选择。
It's better to check in decompiled code as "next version". Yes, there will be lots of changes, but there will be lots of changes anyway.
However, SVN will contain whole project history. Yes, there will be a gap in the history, but anyways, SVN is used to track history. So deleting old versions and starting from beginning is not an option.