开源个小工具simple-repo

来源:互联网 发布:ubuntu镜像文件iso下载 编辑:程序博客网 时间:2024/06/09 04:59

背景

了解android系统的都应该熟悉repo这个工具,google为了方便管理数百个git仓库,开发了repo这个批量管理工具。不过google repo project配置比较麻烦,而通过gitbucket搭建git server则比较傻瓜,所以此处开发了simple-repo这么一个小工具结合gitbucket,实现类google repo的管理目的。

simple-repo介绍:

https://github.com/imagec/simple-repo

  • Why write another copy of repo?
    Sometimes repo project is hard to set up for someone or small company.
    But they can easily set up git server by Gitbucket or Bitbucket.
    If they want to split their project into multi repositories, a tool like repo is required.
  • How to use?
    1)Add the repositories into the repo_manifest list by manual.
    2)Add the prefix of repository url into repo_url_dic, all give it a good name.
    3)Run ./repo init “your name”
    4)The other commands are look like “repo” of Google
    5)…
  • Test?
    I have add two test repositories to let simple repo to manage them

后记

其实开发这个小工具主要有几点原因:

  • google官方的repo project没有搭建成功,设置各种权限很麻烦放弃了。
  • 通过gitbucket或者在线的bitbucket很容易搭建git server,前期我的仓库都放在这个上面。
  • 我就是想练下python,这个工具其实是个副产品,虽然这个代码写的一点不pythonic。

这个工具只在我上家公司使用过,当时用来维护自己的一个工程,该工程有10几个仓库,托管在bitbucket和内部搭建的gitbucket上。唯一感觉有点意思的是,当时和阿里云有个合作,阿里采用标准的repo维护一个项目,我们down下来后,想自己做个内部仓库,在老板尝试搭建标准的repo project无果后,说要不用你写的repo试下能不能管理,(其实我是不情愿的,因为之前全公司就我一个人在推广git,其他人都用svn,对git嗤之以鼻,一点不想转变,更不要说去了解repo了,只有和阿里合作后,被逼无奈用的git,repo)我尝试着添加了一个配置文件到simple-repo,实现了原来用标准repo管理的项目的管理,而且基本上没有修改一行simple-repo的代码,这种感觉还是蛮爽的。