在Linux上创建webrev[基于git]
在Sun/Oracle工作了N(>12)年后,对webrev工具甚为喜欢,因为其易用性确实非常好。幸运的是,有工程师将webrev工具放到了GitHub上,而且支持git。 下面给出使用webrev工具创建代码比对网页的全过程。 当然,首先得保证代码管理工具git在Linux(我用的是Ubuntu14.04)上已经就位和已经安装了ksh,因为webrev工具是基于ksh实现的。
第1步: Clone webrev from here
veli$ cd /var/tmp
veli$ git clone https://github.com/joyent/webrev.git
Cloning into 'webrev'...
remote: Counting objects: , done.
remote: Total (delta ), reused (delta ), pack-reused
Unpacking objects: % (/), done.
Checking connectivity... done. veli$ tree webrev
webrev
├── 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:$PATH
veli$ type webrev
webrev is /var/tmp/webrev/bin/webrev
第3步: Set up apache2
veli$ sudo apt-get install apache2
veli$ sudo service apache2 status
veli$ cd /var/www/html && sudo ln -s /var/tmp t
veli$ 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.git
Cloning into 'vCodeHub'...
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta ), pack-reused
Receiving objects: % (/), 7.85 MiB | 1.61 MiB/s, done.
Resolving deltas: % (/), done.
Checking connectivity... done.
Now update a file,
veli$ cd /var/tmp/sandbox/vCodeHub/sharpsword/c
veli$ vi sudorax.c
第5步: commit changes
veli$ git commit -a
//: demo to use webrev
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Your branch is up-to-date with 'origin/master'.
#
# Changes to be committed:
# modified: sudorax.c
# veli$ git show
commit eb08966d562c03abbe538615a60b0ba648c9cadf
Author: Vector Li <idorax@.com>
Date: Sun May :: + //: demo to use webrev diff --git a/sharpsword/c/sudorax.c b/sharpsword/c/sudorax.c
index 3f334c5..
--- a/sharpsword/c/sudorax.c
+++ b/sharpsword/c/sudorax.c
@@ -, +, @@ typedef unsigned long uint32_t;
static uint64_t
power(int32_t n, uint32_t m)
{
- uint32_t i;
uint64_t sum = ;
-
- for (i = ; i < m; i++)
+ for (uint32_t i = ; i < m; i++)
sum *= n;
-
return sum;
}
第6步: create webrev
veli$ webrev
WARNING: codereview() 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/hosts
127.0.0.1 localhost
127.0.0.1 idorax
于是访问 http://idorax/t/sandbox/webrev
多么熟悉的web页面,终于出现了! Thank opensolaris, thank illumos! 点击Frames,
多么熟悉的代码比对页面,倍感亲切呀:-)
结束语: 能在家里的Linux上用上webrev,实在是太幸福了!归根结底就一句话, 感谢opensolaris, 感谢illumos!
在Linux上创建webrev[基于git]的更多相关文章
- 在Linux上创建webrev(cont)[基于svn]
在前文中,基于git介绍了webrev工具.实际上,webrev工具还支持hg和svn.最近的工作中不可避免地要使用svn,故在此总结一下如何基于svn在Linux上创建webrev.顺便吐个槽,没有 ...
- 在LINUX上创建GIT服务器【转】
转自:http://blog.csdn.net/xiongmc/article/details/9176785 如果使用git的人数较少,可以使用下面的步骤快速部署一个git服务器环境. 1. Cli ...
- 在Linux上用Apache搭建Git服务器
在Linux上用Apache搭建Git服务器 最近在学Linux,终于在Linux上用Apache搭建起了Git服务器,在此记录一下. 服务器:阿里云服务器 Linux版本:CentOS 6.5 ...
- 简易搭建git仓库、关联远程和本地仓库方法。克隆仓库方法。同一台电脑上创建两个git ssh key方法。
一,在github上建仓库 react-js-antd-demo: 二:将远程仓库与本地仓库关联 git remote add origin git@github.com:begin256/react ...
- #内存不够,swap来凑# Linux上创建SWAP文件/分区
转自:https://www.vmvps.com/how-to-create-a-swap-file-on-the-linux-os.html 很久很久以前,电脑的内存是个珍贵东西,于是乎就有了swa ...
- 如何在Linux上创建,列出和删除Docker容器
本篇文章介绍的内容是关于在Linux机器上创建,列出和删除docker容器,下面我们来看具体的内容. 1.启动Docker容器 使用下面的命令启动新的Docker容器.这将启动一个新的容器,并为你提供 ...
- Ubuntu 18.04 Linux上安装Etherpad,基于Web的实时协作编辑器
介绍 Etherpad是一个开源的,基于Web的实时协作编辑器(http://www.0834nanke.com) 它允许多个人使用他们的Web浏览器同时编辑文档. 它还提供了一些很酷的功能,如富文本 ...
- Linux上创建SSH隧道
Win上有好用的Xshell,可以做SSH隧道,但是Linux没有很好用的工具,本来gSTM还可以,但是死活装不上,也很久没更新了. 但其实,Linux上直接使用ssh命令就可以创建SSH隧道,非常方 ...
- 在 Linux 上创建第一个 Service Fabric Java 应用程序
先决条件 开始之前,请安装 Service Fabric SDK.Azure CLI,并在 Linux 开发环境中设置开发群集. 如果使用 Mac OS X,则可使用 Vagrant 在虚拟机中设置 ...
随机推荐
- zookeeper zoo.cfg配置文件
一.zookeeper的配置文件 zoo.cfg 配置文件是我们安装zookeeper的时候复制 重命名出来的文件 命令: cp zoo_smaple.cfg zoo.cfg zkSe ...
- [转载]MVC、MVP以及Model2(下)
通过采用MVC模式,我们可以将可视化UI元素的呈现.UI处理逻辑和业务逻辑分别定义在View.Controller和Model中,但是对于三者之间的交互,MVC并没有进行严格的限制.最为典型的就是允许 ...
- Regular进阶: 几点性能优化的建议
本文由作者郑海波授权网易云社区发布. 本文旨在用 20% 的精力解决使用Regular过程中 80% 的性能问题. 这里大部分是关于脏检查的性能优化,不了解的可以先看下<Regular脏检查介绍 ...
- JVM垃圾收集器(2)
此文已由作者赵计刚薪授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 1.G1 说明: 从上图来看,G1与CMS相比,仅在最后的"筛选回收"部分不同(CMS ...
- 瞄一眼,带你走进SparkSQL的世界
本文由 网易云发布. 作者:范欣欣(本篇文章仅限知乎内部分享,如需转载,请取得作者同意授权.) 最近想来,大数据相关技术与传统型数据库技术很多都是相互融合.互相借鉴的.传统型数据库强势在于其久经考验 ...
- iOS Objective-C 中 bool 与 BOOL 的你不一定知道的事
测试一下这段代码: - (void)test { NSLog(@"this is an attribut: %d", anAttribute); ; i < ; i++) { ...
- iOS 错误:… is being deallocated while key value observing are still registered with it
这个错误从字面上来看就是有一个实例由于被observing而无法被释放. 具体原因可能是该对象添加了一个oberver.所以释放的时候要先取消observer. 具体方法是在 dealloc 方法中: ...
- python中的内置函数,递归,递归文件显示(二),二分法
1.部分内置函数 repr()显示出字符串的官方表示形式,返回一个对象的string形式 # repr 就是原封不动的输出, 引号和转义字符都不起作用 print(repr('大家好,\n \t我叫周 ...
- java.lang.IllegalStateException: Cannot call sendError() after the response has been committed解读
源代码: @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Ob ...
- CCF CSP 201803-1 跳一跳
题目链接:http://118.190.20.162/view.page?gpid=T73 问题描述 近来,跳一跳这款小游戏风靡全国,受到不少玩家的喜爱. 简化后的跳一跳规则如下:玩家每次从当前方块跳 ...