f | = Coderev - simple code review tool = | f | = Coderev - simple code review tool = |
| | | |
| == Overview == | | == Overview == |
| | | |
| Code review before check in code changes is a must in most projects, but what | | Code review before check in code changes is a must in most projects, but what |
| will you do if you want other developers to review your changes? Send them | | will you do if you want other developers to review your changes? Send them |
| the diff generated by "svn diff" or "cvs diff" or something else? I beleive | | the diff generated by "svn diff" or "cvs diff" or something else? I beleive |
| that would bring a lot of pain to the reviewers - raw diffs are difficult to | | that would bring a lot of pain to the reviewers - raw diffs are difficult to |
| read when you changed many lines. | | read when you changed many lines. |
| | | |
| Coderev is just the thing you need for effective code review. Coderev is a | | Coderev is just the thing you need for effective code review. Coderev is a |
| quite simple and small toolkit that can | | quite simple and small toolkit that can |
| | | |
| * Compares files/dirs and generates side-by-side html pages | | * Compares files/dirs and generates side-by-side html pages |
| * Generates side-by-side html pages on your SVN working copy | | * Generates side-by-side html pages on your SVN working copy |
| * More (TODO) | | * More (TODO) |
| | | |
| == Status == | | == Status == |
| | | |
n | Basic function is alreay implemented on top of python difflib. | n | Basic function is already implemented on top of python difflib. |
| | | |
| == Usage == | | == Usage == |
| | | |
n | | n | Checkout trunk revision http://code.google.com/p/coderev/source/checkout or |
| Download from http://code.google.com/p/coderev/downloads/list and extract the | | download from http://code.google.com/p/coderev/downloads/list and extract the |
| tarball to your disk, there are two tools present for you - codediff.py (to | | tarball to your disk, there are two tools present for you - codediff.py (to |
| compare files/dirs) and coderev.sh (to generate code review page on your svn | | compare files/dirs) and coderev.sh (to generate code review page on your svn |
| work space). | | work space). |
| | | |
| * codediff.py usage | | * codediff.py usage |
| | | |
| codediff.py [options] OLD NEW | | codediff.py [options] OLD NEW |
| codediff.py OLD NEW [options] | | codediff.py OLD NEW [options] |
| | | |
| Diff two files/directories and produce HTML pages. | | Diff two files/directories and produce HTML pages. |
| | | |
| Options: | | Options: |
| -h, --help show this help message and exit | | -h, --help show this help message and exit |
| -o OUTPUT, --outupt=OUTPUT | | -o OUTPUT, --outupt=OUTPUT |
| specify output file or directory name | | specify output file or directory name |
| -c, --context generate context diff (default is full diff), only | | -c, --context generate context diff (default is full diff), only |
| take effect when diffing two files | | take effect when diffing two files |
| -f FILE, --filelist=FILE | | -f FILE, --filelist=FILE |
| specify a file list to read from, filelist can be | | specify a file list to read from, filelist can be |
| generated by find -type f, specify - to read from | | generated by find -type f, specify - to read from |
| stdin | | stdin |
| -p NUM, --striplevel=NUM | | -p NUM, --striplevel=NUM |
| for all pathnames in the filelist, delete NUM path | | for all pathnames in the filelist, delete NUM path |
| name components from the beginning of each path name, | | name components from the beginning of each path name, |
| it is similar to patch(1) -p | | it is similar to patch(1) -p |
| -n NUM, --lines=NUM specify context line count when generating context | | -n NUM, --lines=NUM specify context line count when generating context |
| diffs or unified diffs, default is 3 | | diffs or unified diffs, default is 3 |
| -w WIDTH, --wrap=WIDTH | | -w WIDTH, --wrap=WIDTH |
| specify column number where lines are broken and | | specify column number where lines are broken and |
| wrapped for sdiff, default is no line wrapping | | wrapped for sdiff, default is no line wrapping |
| -y, --yes do not prompt for overwriting | | -y, --yes do not prompt for overwriting |
| | | |
n | | n | |
| * coderev.sh usage | | * coderev.sh usage |
| | | |
n | | n | (optional) cp coderevrc.sample ~/.coderevrc, customize your own |
| | | cd your-workspace |
| coderev.sh [-r revsion] [file|subdir ...] | | coderev.sh [-r revsion] [-w width] [file|subdir ...] |
| | | |
n | `revision' is a revision number, or symbol (PREV, BASE, HEAD), see svn | n | `revision' is a revision number, or symbol (PREV, BASE, HEAD) in svn, |
| books for details. Default revision is revision of your working copy | | see svn books for details. Default revision is revision of your working |
| (aka. BASE) | | copy |
| | | |
| | | `width' is a number to make code review pages wrap in specific column |
| | | |
| Default `subdir' is working dir. | | Default `subdir' is working dir. |
| | | |
| Example 1: | | Example 1: |
n | coderev.sh bin lib | n | coderev.sh -w80 bin lib |
| | | |
n | Generate coderev based on your working copy. If you are working on the | n | Generate coderev based on your working copy, web pages wrap in column 80. |
| most up-to-date version, this is suggested way (faster). | | If you are working on the most up-to-date version, this is suggested way |
| | | (faster). |
| | | |
t | Example 2: | t | Example 2 (for SVN): |
| coderev.sh -r HEAD bin lib | | coderev.sh -r HEAD bin lib |
| | | |
| Generate coderev based on HEAD revision (up-to-date version in repository), | | Generate coderev based on HEAD revision (up-to-date version in repository), |
| this will retrive diffs from SVN server so it's slower, but most safely. | | this will retrive diffs from SVN server so it's slower, but most safely. |
| | | |
| == Contact == | | == Contact == |
| | | |
| Comments appreciated, please send to <project owner> at gmail.com. | | Comments appreciated, please send to <project owner> at gmail.com. |