Github 是一個非常好的代碼協(xié)作平臺,對于我自己來說,我?guī)缀跞康拇a工作都是在 Github 上面完成如迟,雖然 Github 的 Web 界面做的非常的不錯,但我發(fā)現(xiàn)攻走,如果項(xiàng)目太多殷勘,如何很好的跟人協(xié)作就成了一個問題。
譬如對于我來說昔搂,我現(xiàn)在最關(guān)注的項(xiàng)目是 tikv玲销,然后工作中還需要關(guān)注 PD,raft-rs摘符,grpc-rs贤斜,rust-prometheus,rust-rocksdb 等多個項(xiàng)目议慰,同時蠢古,我還需要關(guān)注我自己的幾個開源項(xiàng)目 go-mysql,go-mysql-elasticsearch别凹,ledisdb草讶。粗略算下來,我一天至少要在十幾個工程中穿梭炉菲,對這些項(xiàng)目進(jìn)行追蹤堕战,review 一打的 PR,提 comments拍霜,然后看相關(guān)的 comments 的反饋嘱丢,看 team 成員最近的工作進(jìn)展。雖然 Github 的 notifications 機(jī)制能幫我減輕很多的工作祠饺,但我仍然覺得疲于應(yīng)付越驻。
為了讓我在這么多個項(xiàng)目中游刃有余的進(jìn)行切換工作,我一直在尋找相關(guān)的工具道偷。不過可能是因?yàn)槲倚枰墓ぞ叨ㄖ菩蕴珡?qiáng)缀旁,所以一直沒找到合適的。但程序員的優(yōu)點(diǎn)就在于沒有工具勺鸦,自己造一個并巍。于是就有了 github-cli。
首先來說說我想要的是什么樣的工具换途,它只是一個 CLI懊渡,也就是只需要命令行運(yùn)行就成刽射,沒啥 Web 的東西,這樣我用鍵盤就能操作了剃执。當(dāng)然誓禁,以后能做成 Web 更好,畢竟有時候點(diǎn)鼠標(biāo)這事情還是很方便的忠蝗。
其次现横,這個工具其實(shí)不需要特別復(fù)雜,只需要干幾件事情:
- 獲取一段時間不同語言在 Github 上面的 trending阁最,這樣我就能知道 Rust戒祠,Go 等我關(guān)心的語言的一些項(xiàng)目的情況。我并不需要知道特定人的 trending
- 能夠獲取一批項(xiàng)目的 Pull Requests 情況速种,譬如最近一段時間 closed 的 PR姜盈,或者是還是 open 狀態(tài)但有更新的 PR 等。也能夠?qū)μ囟ǖ?PR 進(jìn)行查看配阵,顯示出詳細(xì)的 comments 信息馏颂。
- 上面提到了 Pull Requests,自然也需要有同樣的功能對 Issues 進(jìn)行追蹤棋傍。
- 能夠?qū)ξ易约壕壤蛘吣硞€用戶進(jìn)行追蹤,譬如他/她最近一段時間提交了什么 PR瘫拣,review 了哪些 PR亿絮,回復(fù)了哪些 Issue 等。
對于 github-cli麸拄,使用也很簡單派昧,首先需要一個配置文件,配置文件大概的格式如下:
account = "siddontang"
[[repos]]
owner = "tikv"
name = "tikv"
[[repos]]
owner = "pingcap"
name = "pd"
最開始就是 account拢切,通常就是使用者本人了蒂萎。然后就是需要關(guān)注的工程列表,owner 就是這個工程所在的用戶或者組織名字淮椰,name 則就是工程名字了五慈。我們可以把這個文件放在 ~/.github-cli/config.toml
,這樣 github-cli 工具就會默認(rèn)讀取主穗。
你也可以在 ~/.github-cli/token
里面存放你自己的 Github token泻拦,不過因?yàn)?github-cli 工具現(xiàn)在都是只讀的操作,要不要 token 都無所謂黔牵。
配置好之后,我們就可以操作了爷肝。首先猾浦,我想關(guān)注下最近一周的 trending 情況陆错,直接運(yùn)行
github-cli trending
[JavaScript] https://github.com/antvis/f2 ????An elegant, interactive and flexible charting library for mobile.
https://github.com/trimstray/test-your-sysadmin-skills A collection of *nix Sysadmin Test Questions and Answers for Interview/Exam (2018 Edition).
[C] https://github.com/aergoio/litetree SQLite with Branches
[JavaScript] https://github.com/felixrieseberg/windows95 ???? Windows 95 in Electron. Runs on macOS, Linux, and Windows.
反正無論怎么運(yùn)行,JavaScript 的項(xiàng)目都是排在前列的 :-)
或者只是關(guān)注下 Rust 的情況
github-cli trending rust
[Rust] https://github.com/tikv/tikv Distributed transactional key-value database, originally created to complement TiDB
[Rust] https://github.com/rust-lang/rust A safe, concurrent, practical language.
比較幸運(yùn)金赦,TiKV 這個項(xiàng)目經(jīng)常在 trending 里面音瓷。
我想關(guān)注下 TiKV 最近還沒合并的 PR 情況,按照 update 的時間逆序排序
github-cli pulls tikv
tikv/tikv
2018-09-01 06:26:48 https://github.com/tikv/tikv/pull/3554 coprocessor/dag/expr: add un-pushed builtin UDFs(md5)
2018-09-01 06:05:44 https://github.com/tikv/tikv/pull/3535 docs: add TiKV Coprocessor config doc
2018-09-01 06:02:46 https://github.com/tikv/tikv/pull/3495 Move coprocessor test utilites to test_coprocessor library
或者是近期已經(jīng) closed 掉的 PR
github-cli pulls tikv --state closed
tikv/tikv
2018-09-01 04:28:05 https://github.com/tikv/tikv/pull/3526 docs: Add RocksDB option config doc
2018-08-31 09:46:20 https://github.com/tikv/tikv/pull/3545 store/util: human readable expired time
2018-08-31 08:31:29 https://github.com/tikv/tikv/pull/3502 docs: add TiKV Control User Guide
然后看看某一個 PR 具體的情況
github-cli pull tikv 3344
Title: Separate Mvcc Reader
Created at 2018-07-24 15:44:07
Message:
<!--
Thank you for contributing to TiKV! Please read TiKV's [CONTRIBUTING](https://github.com/pingcap/tikv/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
-->
## What have you changed? (mandatory)
This PR separates the `mvcc::MvccReader` into multiples:
- [x] `mvcc::PointGetter`: Provides mvcc point get operation.
- [x] `mvcc::ForwardSeeker`: Provides mvcc forward seek operation.
- [x] `mvcc::ReverseSeeker`: Provides mvcc reverse seek operation.
- [x] `mvcc::CFReader`: Other mvcc operations not listed above are managed by this struct.
當(dāng)然 issue 也是一樣的操作夹抗,譬如最近更新的 issue 情況
github-cli issues tikv
tikv/tikv
2018-08-31 06:09:34 https://github.com/tikv/tikv/issues/3550 Log cleaning
2018-08-31 01:26:30 https://github.com/tikv/tikv/issues/3549 remove many box creations in the nested callbacks
2018-08-30 13:38:16 https://github.com/tikv/tikv/issues/3548 Reload configuration at runtime
當(dāng)然绳慎,也可以追蹤下我自己這段時間干了啥事情
github-cli events
2018-09-01 06:45:02 - IssueComment: https://github.com/slog-rs/stdlog/pull/6 what do you think @dpc
2018-08-31 07:57:43 - PullComment: https://github.com/pingcap/pd/pull/1222 what does fixPeer mean?
2018-08-31 07:18:25 - IssueComment: https://github.com/pingcap/rust-rocksdb/issues/217 PTAL @DorianZheng
2018-08-31 01:26:30 - Issues: opened https://github.com/tikv/tikv/issues/3549 remove many box creations in the nested callbacks
可以看到,使用 github-cli漠烧,能讓我通過 CLI 就知道多個項(xiàng)目的進(jìn)展情況杏愤。當(dāng)然,這還只是一個簡單的工具已脓,還有很多需要做的珊楼。以后如果能直接在 CLI 上面回復(fù) issue,給 PR 提 comment 那就最好度液,然后可以支持更多的 filter 操作厕宗,譬如只看 assignee 是某幾個人的 issue 或者 PR 這些,或者查看長時間掛著一直沒有更新的 issue 或者 PR 這些堕担,后面有時間在慢慢完善吧已慢。