在Linux上建立網頁版的webrev

來源:互聯網
上載者:User

標籤:with   網頁   solaris   update   start   blog   過程   https   cdif   

在Sun/Oracle工作了N(>12)年後,對網頁版的webrev工具甚為喜歡,因為其易用性確實非常非常好。幸運的是,有工程師將webrev工具放到了GitHub上,而且支援git。 下面給出使用webrev工具建立網頁版webrev的全過程。 當然,首先保證git在Linux(我用的是Ubuntu14.04)上已經安裝好了。

第1步: Clone webrev from here

veli$ cd /var/tmpveli$ git clone https://github.com/joyent/webrev.gitCloning into ‘webrev‘...remote: Counting objects: 27, done.remote: Total 27 (delta 0), reused 0 (delta 0), pack-reused 27Unpacking objects: 100% (27/27), done.Checking connectivity... done.veli$ tree webrevwebrev├── bin│   ├── wdiff│   ├── webrev│   └── which_scm├── etc│   ├── its.conf│   └── its.reg└── README.md

第2步: Add webrev/bin to PATH

veli$ export PATH=/var/tmp/webrev/bin:$PATHveli$ type webrevwebrev is /var/tmp/webrev/bin/webrev

第3步: Set up apache2

veli$ sudo apt-get install apache2veli$ sudo service apache2 statusveli$ sudo cd /var/www/html; ln -s /var/tmp tveli$ sudo vim /etc/apache2/apache2.conf # add "ServerName localhost:80"veli$ sudo service apache2 restart

第4步: clone my source code and update something

veli$ git clone https://github.com/idorax/vCodeHub.gitCloning into ‘vCodeHub‘...remote: Counting objects: 359, done.remote: Compressing objects: 100% (100/100), done.remote: Total 359 (delta 58), reused 0 (delta 0), pack-reused 254Receiving objects: 100% (359/359), 7.85 MiB | 1.61 MiB/s, done.Resolving deltas: 100% (164/164), done.Checking connectivity... done.

Now update a file,

veli$ cd /var/tmp/sandbox/vCodeHub/sharpsword/cveli$ vi sudorax.c

第5步: commit changes

veli$ git commit -a  1 05/14/2017: demo to use webrev  2 # Please enter the commit message for your changes. Lines starting  3 # with ‘#‘ will be ignored, and an empty message aborts the commit.  4 # On branch master  5 # Your branch is up-to-date with ‘origin/master‘.  6 #  7 # Changes to be committed:  8 #       modified:   sudorax.c  9 #veli$ git showcommit eb08966d562c03abbe538615a60b0ba648c9cadfAuthor: Vector Li <[email protected]126.com>Date:   Sun May 14 11:29:11 2017 +0800    05/14/2017: demo to use webrevdiff --git a/sharpsword/c/sudorax.c b/sharpsword/c/sudorax.cindex 3f334c5..4645870 100644--- a/sharpsword/c/sudorax.c+++ b/sharpsword/c/sudorax.c@@ -46,12 +46,9 @@ typedef unsigned long uint32_t; static uint64_t power(int32_t n, uint32_t m) {-       uint32_t i;        uint64_t sum = 1;--       for (i = 0; i < m; i++)+       for (uint32_t i = 0; i < m; i++)                sum *= n;-        return sum; }

第6步: create webrev

veli$ webrevWARNING: codereview(1) not found.   SCM detected: git File list from: git ... Done.      Workspace: /var/tmp/sandbox/vCodeHub (at eb08966d562c)Compare against: origin/master (https://github.com/idorax/vCodeHub.git at c64cf7c91ba6)      Output to: /var/tmp/sandbox/webrev   Output Files:        sharpsword/c/sudorax.c                 patch cdiffs udiffs wdiffs sdiffs frames old new Generating PDF: Skipped: no output available     index.html: Done.

第7步: 在firefox裡訪問webrev

veli$ egrep ‘127.0.0.1‘ /etc/hosts127.0.0.1    localhost127.0.0.1    idorax

於是訪問 http://idorax/t/sandbox/webrev

多麼熟悉的介面,終於出現了! Thank opensolaris, thank illumos! 點擊Frames,

多麼熟悉的代碼比對頁面,倍感親切呀:-)

結束語: 能在家裡的Linux上用上webrev,實在是太幸福了!歸根結底就一句話, 感謝opensolaris, 感謝illumos!

在Linux上建立網頁版的webrev

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.