The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
loushizan

推荐工具 go-diff

  •  1
     
  •   loushizan · Nov 24, 2021 · 3047 views
    This topic created in 1630 days ago, the information mentioned may be changed or developed.

    声明

    非作者,纯推荐

    背景

    最近有个优化 CI 测试速度的需求,目前 CI 是全量跑项目下所有 packages 的 test ,量大且慢

    想的方案是找出一个 GitHub PR 代码改动涉及的 packages 以及相关连的 packages

    结果

    随后面向 Google 一番努力编程💪,成功找到 go-diff

    完全满足我的需求

    基本用法

    # file 协议
    go-diff -repo file://[git_repo_path] -from [from_commit_hash] -to [to_commit_hash]
    # git/https 协议
    go-diff -repo [git_repo_url] -branch [branch_name] -from [from_commit_hash] -to [to_commit_hash]
    

    工具对比了 2 个 commit 之间的代码改动涉及的 packages ,并打印到 stdout

    更详细的用法就去看 README 或者源码

    这次参数都可以在 GitHub PR 内找到,具体看大家用的 CI 系统是什么

    希望能帮助到需要的人🙏

    2 replies    2021-11-24 18:03:18 +08:00
    11373450
        1
    11373450  
       Nov 24, 2021
    可以试试看。我们现在的 ci 测试太久了都
    retanoj
        2
    retanoj  
       Nov 24, 2021   ❤️ 1
    额。。看两个 hash 的 diff
    git diff 不可以满足 LZ 的要求吗?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1199 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 23:23 · PVG 07:23 · LAX 16:23 · JFK 19:23
    ♥ Do have faith in what you're doing.