如何使Subversion(或任何程序)执行定期提交? [英] How to make Subversion (or any program) perform periodic commits?

查看:97
本文介绍了如何使Subversion(或任何程序)执行定期提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想配置计算机,使其每半小时自动提交我正在处理的程序.我正在使用svn信息库,因此即使只是每30分钟运行一次"svn ci"的脚本也可以.问题是我不知道该怎么做.

I want to configure my computer so that say every half an hour it automatically commits the program I am working on. I am using a svn repository so even if it was just a script that ran 'svn ci' every 30 min that would be okay. The problem is that I don't know how to do that.

有人可以告诉我,或引导我去做些什么,让我定期进行提交工作吗?

Could somebody please tell me, or direct me to something, that would let me get this periodic commit stuff working?

谢谢.

对不起,看来我对我为什么要这样做感到困惑.我要这样做的唯一原因是因为我的一位讲师希望我们了解代码随着时间的推移如何发展,并且我认为为此目的使用svn是一个好主意.最近的提交是否起作用并不重要.它只需要显示我对代码所做的更改.

Sorry it appears that I have confused people as to why I would want to do this. The sole reason that I want to do this is because a lecturer of mine wants us to know how our code develops over time and I thought that it would be a great idea to use svn for this purpose. It does not matter if the latest commit works or not. It just has to show the changes I have made to the code over time.

推荐答案

我不会因为这样的一系列自动提交而弄脏您的控件版本系统.但是我同意使用控制版本系统来提供该信息的想法.

I would not dirty your control version system with such series of auto commits. But I agree with the idea of using a control version system to provide that information.

然后,我的建议是:对您的软件使用一个存储库,对另一个存储自动提交的存储库.完成工作后,仅将一个逻辑提交合并到主存储库中的所有自动提交.

Then, my suggestion is: use a repository for your software and another one for store the auto commits. When the work is done, merge all auto commits in the main repository in only one logical commit.

使用git,我会这样做:

With git, I would do this:

  1. 回购'foo':主存储库
  1. Repo 'foo': the main repository
  1. refs/heads/...:您的开发分支机构的位置
  2. refs/sessions/...:带有肮脏提交的工作位置.

  • 您的工作副本:

  • Your working copy:

    1. "git init"
    2. "git remote add foo git://foo/...; git fetch foo"

  • 创建分支:"git checkout -b bar foo/master"
  • 标记分支的开头:"git tag barbegin"
  • 激活脚本:为true时;执行git add -A.; git commit -m'autocommit';完成"
  • 我不会使用cron作业,因此您可以轻松激活/停用自动提交.
  • 做好你的工作
  • 完成工作后,停用脚本
  • 提交待定更改
  • 现在,分支栏中有很多自动提交,并用barbegin标记了分支的初始提交
  • 发布您的自动提交:

  • create the branch: "git checkout -b bar foo/master"
  • tag the begining of the branch: "git tag barbegin"
  • activate the script: "while true; do git add -A .; git commit -m 'autocommit'; done"
  • I would not use a cron job, so you can activate/deactivate the autocommits easily.
  • do your job
  • after your job done, deactivate the script
  • commit pending changes
  • now, you have a lot of auto commits in branch bar, and you have tagged the initial commit of the branch with barbegin
  • publish your auto commits:

    1. "git标签栏"
    2. "git push foo barbegin:引用/会话/您的用户ID/会话ID/开始"
    3. "git push foo barend:引用/会话/您的用户ID/会话ID/结束"

  • 现在,您已经发布了您的作品,您的讲师可以访问它
  • 用于更新您的foo存储库:

  • now, you have published your work and your lecturer may access it
  • for update your foo repository:

    1. "git rebase -i --to barbegin barbegin",然后按照进行操作在这里
    2. 我会压缩所有提交:最后只能有一个."
    3. "git push foo bar:master"#仅推送一次提交

  • 清洁:

  • cleaning:

    1. "git标签-d烧烤"
    2. "git标签-d barend"
    3. "git branch -d bar"

  • 毕竟,我认为不能用此类数据收集有用的信息.因此,我将尽量避免这种工作流程.但是,如果真的需要,我会这样做.

    After all this, I think no useful information may be gathered with such kind of data. So, I would try to avoid this workflow. But if really needed, I would do that way.

    这篇关于如何使Subversion(或任何程序)执行定期提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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