我应该将生成的代码存储在源代码管理中吗 [英] Should I store generated code in source control

查看:67
本文介绍了我应该将生成的代码存储在源代码管理中吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我参加的辩论。我想获得更多的意见和观点。

This is a debate I'm taking a part in. I would like to get more opinions and points of view.

我们有一些课程是在建立时间来处理数据库操作(在这种情况下,使用SubSonic,但我认为这个问题并不重要)。生成设置为Visual Studio中的预构建步骤。因此,每次开发人员(或正式的构建过程)运行构建时,都会生成这些类,然后将其编译到项目中。

We have some classes that are generated in build time to handle DB operations (in This specific case, with SubSonic, but I don't think it is very important for the question). The generation is set as a pre-build step in Visual Studio. So every time a developer (or the official build process) runs a build, these classes are generated, and then compiled into the project.

现在有些人声称,将这些类保存在源代码管理中可能会造成混乱,以防万一您得到的代码与您自己的环境中生成的代码不匹配。

Now some people are claiming, that having these classes saved in source control could cause confusion, in case the code you get, doesn't match what would have been generated in your own environment.

我想甚至有通常将其视为黑匣子的方式,也有办法追溯代码的历史。

I would like to have a way to trace back the history of the code, even if it is usually treated as a black box.

是否有任何参数或计数器参数?

Any arguments or counter arguments?



更新:我问了这个问题,因为我真的相信有一个明确的答案。查看所有答复,我可以肯定地说,没有这样的答案。该决定应基于多个参数来做出。阅读以下答案可以为您在决定此问题时应该问自己的问题类型提供很好的指导。


UPDATE: I asked this question since I really believed there is one definitive answer. Looking at all the responses, I could say with high level of certainty, that there is no such answer. The decision should be made based on more than one parameter. Reading the answers below could provide a very good guideline to the types of questions you should be asking yourself when having to decide on this issue.

我不会选择接受的问题出于上述原因,请在此时回答。

I won't select an accepted answer at this point for the reasons mentioned above.

推荐答案

将其保存在源代码管理中的麻烦多于其价值。

Saving it in source control is more trouble than it's worth.

每次进行构建时,都必须进行一次提交,以使其具有任何值。

You have to do a commit every time you do a build for it to be any value.

通常我们将生成的代码(idl,jaxb的东西等)放在我工作的源代码管理之外,这从来都不是问题

Generally we leave generated code( idl, jaxb stuff, etc) outside source control where I work and it's never been a problem

这篇关于我应该将生成的代码存储在源代码管理中吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆