解决方案中的多个项目与源代码控制中的多个项目

发布于 2024-10-16 04:24:29 字数 859 浏览 2 评论 0原文

大约一年前采用 Kiln 后,我一直坚持每个 Visual Studio 项目都有一个源代码控制项目的惯例。虽然我发现这使提交保持良好和简单,并且源代码控制项目非常集中,但它开始导致大量提交,而这本质上是一个更改。

例子: 我的视觉工作室解决方案之一的设置如下:

  • App.Core(服务层)
  • App.Core.Tests(测试层)
  • App.Web.Core(控制器)
  • App.Web.UI(视图/js/等..)
  • App .Web.Admin(网络管理站点)
  • App.Web.Tests(测试层)
  • App.ChromeExtension

最终我还将添加一个andriod和iphone视图层(可能是monotouch/monodriod)

假设我在服务层端需要更新界面,然后我必须通过各种 Web 方法甚至可能是 chrome 扩展来传播该更改。这非常简单,但这可能意味着我必须为本质上一个“更改”进行最多 7 次不同的提交。这还意味着当我切换到笔记本电脑或从笔记本电脑切换出来时,需要为其他开发人员或我自己进行大量更改。

处理过大型项目的人可以评论一下这里的“最佳”方法是什么吗?我是否坚持使用多个源代码控制项目,以便每个提交树都非常简洁并处理开销?为了简单起见,我是否将所有内容都放在一个源代码控制项目中?我是否会进行混合,将所有与网络相关的内容合并到一个项目中,并将所有与服务相关的内容合并到另一个项目中?或者其他什么?

仅供参考:该项目由用户体验开发人员和我自己维护,但将来很容易改变。

(另外:我不确定这是否是程序员或 stackoverflow 值得的,所以决定去这里。如果 mod 想要移动它,我不反对。)

谢谢!

After adopting Kiln a year or so back, I've been sticking to the convention of having one source control project per one visual studio project. While I find this keeps the commits nice and simple and the source control project very focused, its starting to lead to a LOT of commits for what's essentially one change.

Example:
One of my visual studio solutions is setup like this:

  • App.Core (service layer)
  • App.Core.Tests( testing layer)
  • App.Web.Core (controllers )
  • App.Web.UI (views/js/etc..)
  • App.Web.Admin (administrative site for the web)
  • App.Web.Tests (testing layer)
  • App.ChromeExtension

Eventually I'll be adding an andriod and iphone view layer as well (probably monotouch/monodriod)

Say I add a feature on the service layer side that required an update to the interface, I then have to propagate that change through the various web methods and maybe even the chrome extension. That's pretty straight-forward, but it could mean me having to do up to 7 different commits for what's essentially a single "change". It also means pulling a lot of changes for other developers or for myself when I switch to/from my laptop.

Can someone who's dealt with large projects comment on what the "best" approach is here? Do I stick with the multiple source control projects so each commit tree is super concise and deal with the overhead? Do I stick everything in a single source control project for simplicity? Do I do a hybrid where I merge anything web related into one project, and anything service related into another project? Or something else?

For reference: the project is maintained by a UX developer and myself, but that could easily change in future.

(also: I wasn't sure if this was programmers or stackoverflow worthy, and decided to go here instead. If a mod wants to move it I've no objection.)

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

少年亿悲伤 2024-10-23 04:24:29

一旦您拥有相互依赖的组件(一组文件,此处为解决方案),其中一个模块的更改必须传播到其他模块,您可以考虑“系统”方法(即一个存储库,其中包含所有内容):
如果您认为不能只在一个模块上添加标签而不在所有其他模块上设置该标签,那么这是有道理的。

如果这些组件可以彼此独立开发,您可以通过编写脚本来减少提交数量,就像在这个脚本 'git-submodule-recur.sh:' 中一样(此处针对 Git):

#!/bin/sh

case "$1" in
        "init") CMD="submodule update --init" ;;
        *) CMD="$*" ;;
esac

git $CMD
git submodule foreach "$0" $CMD

然后将在每个子模块中提交一个命令:

git-submodule-recur commit -a -m "some comment" 

As soon as you have inter-dependent components (set of files, here solutions), where one change to one module has to propagate to the others, you could consider a "system" approach (i.e. one repository, with everything in it):
That make sense if you consider that you cannot have a tag on just one module without setting that tag on all the others.

If those components can be developed independently one from another, you could mitigate the number of commits by scripting them, like in this script 'git-submodule-recur.sh:' (here for Git):

#!/bin/sh

case "$1" in
        "init") CMD="submodule update --init" ;;
        *) CMD="$*" ;;
esac

git $CMD
git submodule foreach "$0" $CMD

One command would then commit in every submodules:

git-submodule-recur commit -a -m "some comment" 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文