Skip to content

zhaoyul/git-cmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

目标

一个命令行工具/库

工作流程

+---------------------+
|   repo directory    |     ;; a dir containing a .git subdir
+----------+----------+
           |
           |
+----------+----------+
|    find all src     |     ;; exclude resoruces, 3party files, configurations dirs
+----------+----------+
           |
           |
+----------v----------+
|    find all commits |     ;; find all distinct commits(on all branches)
+----------+----------+
           |
           |
           |
+----------v----------+
|    author mapping   |     ;; kevin.li kevin lizy are the same person
+----------+----------+
           |
           |
           |
           |
+----------v----------+
|ignore certain diffs |     ;; exclude certain files (generated files)
+----------+----------+
           |
           |
           |
+----------v----------+
| count dif| lines    |     ;; added, or deleted lines for certain commit
+----------+----------+
           |
           |                   +-------------------------------------------------+
           |                   | charts                                          |
           |                   |                                                 |
+----------v----------+        |   1. commits by cretain author (per week,month) |
| List of all commits |        |   2. lines connts per mohth|week per author     |
| with date, changed  +-------->   3. commits by time range every 4 hours.       |
| line nums and author|        |   4. commits count distribution by author       |
+----------+----------+        |   5. line count distribution by author          |
           |                   |   6. file type line counts distribution         |
           |                   |   7. etc.                                       |
           |                   |                                                 |
           |                   +-------------------------------------------------+
+----------+----------+        | overview charts                                 |
|  combining repos    +-------->   1. line connts per repo                       |
+---------------------+        |   2. commits counts per repo                    |
                               |   3. etc.                                       |
                               +-------------------------------------------------+

命令行接受的参数

  • -r “repo-dir” -t “title”
  • -c “config.edn”

config.edn

{:repos [{:url "https://github.com/zhaoyul/snippets.git"   ;; git address
          :name "代码片段"                                 ;; will show in charts
          :authors {"lizy" "李照宇"                        ;; author mapping
                    "kevin.li" "李照宇"}}]}
  • 需要分析的远端的git地址
  • repo的名字
  • 需要配置git作者的映射

使用jgit来操作git, 目的是为了要统计git的数据 [0/0]

  • [0/0] 针对单个repo
    • [2/2] 统计当前workspace下的git代码的归属
      • [X] 能够获得当前的库的代码构成
      • [X] 能够缓存上面的条目的结果
        • [X] 以天为单位进行缓存, 每天生成一个缓存文件
        • [X] 暂时放在本目录下
        • [X] 完成作者的名字的归属的映射
        • [X] 用xchart完成绘图
        • [X] 打包当前的工作, 形成命令行工具
    • [4/4] 统计所有的分枝上的commit
      • [X] 搬迁以前的代码到当前工程
      • [X] 统计该repo在所有的分枝上的commit的基础信息
      • [X] 基础信息写入cache文件
      • [X] 汇总不同作者的在某个时间段的commit
        • [X] 上个月的commit统计
        • [X] 定一个函数能够根据时间段统计commit的数量
        • [X] 生成图表
    • [5/7] 统计所有的分枝上的commit的文件修改
      • [X] 从commit -> patch
        • [X] commit 如果是merge, 也需要忽略掉
      • [X] 分析patch中的代码类型
        • [X] 文件后缀有乱字符
        • [X] 有解析文件后缀后, 后缀为空的情况
        • [X] 需要能够排除掉二进制文件以及不需要统计的文件类型, 比如md, org
      • [X] 分析patch中的代码修改数量
      • [X] 更新commit的缓存文件, 保留具体的文件修改记录
      • [X] 按author/时间生成行数的统计图表
      • [ ] 命令行封装
      • [ ] 配置摘出来放到配置文件
  • [0/0] 多个repo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published