博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在Linux上创建webrev[基于git]
阅读量:4507 次
发布时间:2019-06-08

本文共 3204 字,大约阅读时间需要 10 分钟。

在Sun/Oracle工作了N(>12)年后,对webrev工具甚为喜欢,因为其易用性确实非常好。幸运的是,有工程师将webrev工具放到了GitHub上,而且支持git。 下面给出使用webrev工具创建代码比对网页的全过程。 当然,首先得保证代码管理工具git在Linux(我用的是Ubuntu14.04)上已经就位和已经安装了ksh,因为webrev工具是基于ksh实现的。

第1步: Clone webrev from

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$ cd /var/www/html && sudo 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 
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

多么熟悉的web页面,终于出现了! Thank opensolaris, thank ! 点击Frames,

多么熟悉的代码比对页面,倍感亲切呀:-)

结束语: 能在家里的Linux上用上webrev,实在是太幸福了!归根结底就一句话, 感谢opensolaris, 感谢illumos!

转载于:https://www.cnblogs.com/idorax/p/6851930.html

你可能感兴趣的文章
JVM虚拟机笔记(3)-- 类加载器实践热部署
查看>>
Windows照片查看器--全屏浏览查看
查看>>
使用LinkedList存储一副扑克牌,然后实现洗牌功能。
查看>>
Windows环境下使用bitvise架构sftp服务器
查看>>
Python爬虫urllib2库基本使用
查看>>
[计算机网络] 一些应用对应的的应用层协议及传输层协议
查看>>
学习进度五
查看>>
【转】Git操作
查看>>
2014暑期最后一次个人赛
查看>>
●洛谷P1291 [SHOI2002]百事世界杯之旅
查看>>
软工网络15团队作业2——团队计划
查看>>
MySQL--创建用户
查看>>
isIos
查看>>
js+canvas实现滑动拼图验证码功能
查看>>
华为ensp工具栏丢失解决方法
查看>>
静态网页中的使得文字向上一直滚动,中间不间断。
查看>>
MySQL常见错误代码说明
查看>>
innobackupex 相关语法讲解【转】
查看>>
pt-table-sync同步报错Called not_in_left in state 0 at /usr/bin/pt-table-sync line 5231【原创】...
查看>>
jooq使用示例
查看>>