开发者

What is a good tool choice if I wanted daily automated commits? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 1 year ago.

开发者_如何学运维 Improve this question

I am doing some development by myself, and would like to have my code put into a RCS, and for ease I would like it to automatically commit all my changed code every night, with the option of tagging source at various times to mark good build. Any suggestions? I am using ubuntu.


IMO this is a misuse of revision control. You are using it for backup, not revision control.

When you commit, you should be committing logical chunks of work, that compile, with appropriate comments. Commits with none of the above at regular intervals really have nothing to do with RCS.


Just commit your changed code when you are done coding. It only takes a couple of seconds and that way you'll know exactly what is going on and be able to add relevant comments.


I like the idea of not using a version control system for backups. I'd stick to logical commits and - just run a cronjob at the wished time to create a patch file for example with subversion:

cd /foo/bar &&
svn diff > patch_r`svn info|grep Revision|cut -d ' ' -f 2`-`date +%Y%m%d_%H%M%S`.diff

This will result in patch files named like this: patch_r50143-20100831_153758.diff

That way you always know to which revision this patch applies without looking into it and the backups patches will be well sorted.

Btw: svn status shows all modified files..


I suggest to write a bash script that looks for files that have changed and comits them via RCS commandline. For scheduling the execution of that script I would use cron jobs under ubuntu. There's also a gui for managing cron jobs called gnome-schedule which you have to install first via apt.

edit:

Something which might help you: Get file modification date/time in Bash script

Simply use date -r $file +%F to get the date of $file


I ended up using subversion, and making a cronjob to commit everyday. It only commits changed files.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜