FYI: Phabricator's topic branches on Git monorepo

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 5 19:32:10 PDT 2017


Here's the repository.
https://github.com/llvm-project/llvm-project-phab/branches
For now, it is updated manually.

* What is?
This fetches all open and visible differentials from
https://reviews.llvm.org/ via conduit API.
Based on Git monorepo, https://github.com/llvm-project/llvm-project-20170507
 .

Closed diffs will be removed. git-fetch --prune will help.

* How to play?
Prerequisite: You are on
https://github.com/llvm-project/llvm-project-20170507
$ git remote add phab https://github.com/llvm-project/llvm-project-phab.git
$ git fetch phab --prune

* How to abandon playing?
$ git remote rm phab

* Future plans
- Implement building topic branches with http://bb.pgr.jp/
- Synthesize and provide "dev/trunk" with merging topic branches
- Interact with https://reviews.llvm.org/ for building results

* Issues
- Not all diffs can be generated. They might have unknown changes in their
parents.
- Changes are not cascaded unless each change points a preceding change.
- If diffs don't have "Modified" files but "New" files, branches cannot be
made.
  Heuristics depends on "orig" context of diff.
- Due to lack of conduit API, this has to fetch whole diff with
https://reviews.llvm.org/api/differential.querydiffs
  It has hundreds kilobytes of changes if it is generated from full context
diff.
  Therefore, I won't run this automatically.
  (Let me know if there's an expert of conduit API)
- Each diff's author doesn't have full fields. API can know his name but
not his mailto.
  (I could retrieve possible fields in trunk with his name...)

* How this works?
This relies on many heuristics.
- If a diff is full-context, calculate its each hash as git blob.
- Traverse the tree and walk revisions and check blobs' hashes matching;
  1) Preceding diffs in the same topic
  2) Just the commit, if a diff knows SVN revision number
  3) The newest commit in trunk with git-log --before (changes' ctime)
  4) All visible branches with git-log --branches
  5) Walk down changes (1)-(4) to (ctime - 28 days)
  6) (Also if a diff isn't full-context) Try applying patches to an actual
tree with git-apply

Arigato, Takumi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170606/fe4fb6af/attachment.html>


More information about the llvm-commits mailing list