Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 31cd0ba504
Fetching contributors…

Cannot retrieve contributors at this time

160 lines (117 sloc) 6.978 kb
*patchreview.txt* Vim global plugin for doing single, multi-patch or diff code reviews
Version 1.0.2 (for Vim version 7.0 or higher)
Author: Manpreet Singh < junkblocker@yahoo.com >
Copyright (C) 2006-2011 by Manpreet Singh
License : This file is placed in the public domain.
=============================================================================
CONTENTS *patchreview* *diffreview* *patchreview-contents*
1. Contents.........................................: |patchreview-contents|
2. Introduction.....................................: |patchreview-intro|
3. PatchReview Usage................................: |patchreview-usage|
4.1 DiffReview Usage.............................: |:DiffReview|
4.2 PatchReview Usage............................: |:PatchReview|
4.3 ReversePatchReview Usage.....................: |:ReversePatchReview|
4. PatchReview options..............................: |patchreview-options|
5. Hooks............................................: |patchreview-hooks|
6. Adding new version control plugins...............: |patchreview-plugins|
=============================================================================
PatchReview Introduction *patchreview-intro*
The Patch Review plugin allows easy single or multipatch code or diff reviews.
It opens each affected (modified/added/deleted) file in the patch or in a
version controlled workspace diff in a diff view in a separate tab.
VIM provides the |:diffpatch| and related commands to do single file reviews
but can not handle patch files containing multiple patches as is common with
software development projects. This plugin provides that missing
functionality.
It also improves on |:diffpatch|'s behaviour of creating the patched files in
the same directory as original file which can lead to project workspace
pollution.
It does automatic diff generation for various version control systems by
running their diff command.
=============================================================================
PatchReview Usage *patchreview-usage* *diffreview-usage*
*:DiffReview*
:DiffReview [[optional_strip_count] optional_diff_generation_command]
Perform a diff review in the current directory under version control.
Currently supports Mercurial (hg), Subversion (svn), CVS, Bazaar (bzr),
Monotone and Perforce (p4) version control systems.
If the optional diff generation command is supplied, that is used to
generate the diff to review instead. This allows you to handle commands
which are not the default diff command of the version control system.
For example, if you want to review git staged diffs, you can run this: >
:DiffReview 1 git staged --no-color -U5
<
Here, since git diffs have a/ and b/ file path prefixes in the output, a
strip level of 1 is specified. However, that is only needed rarely as the
plugin tries to guess the correct strip count itself.
Note Only context or unified diff format patches are supported.
*:PatchReview*
:PatchReview patchfile_path [optional_source_directory [optional_strip_count]]
Perform a patch review in the current directory based on the supplied
patchfile_path. If optional_source_directory is specified, patchreview is
done on that directory.
Note Only context or unified diff format patches are supported.
*:ReversePatchReview*
:ReversePatchReview patchfile_path [optional_source_directory [optional_strip_count]]
Perform a reverse patch review of an already applied patch in the current
directory based on the supplied patchfile_path. If
optional_source_directory is specified, patchreview is done on that
directory.
Note Only context or unified diff format patches are supported.
=============================================================================
PatchReview Options *patchreview-options*
*g:patchreview_patch*
*patchreview_patch*
g:patchreview_patch = {string}
Optional path to patch binary. |PatchReview| tries to locate patch on
system path automatically. If the binary is not on system path, this
option tell |PatchReview| the full path to the binary. This option, if
specified, overrides the default patch binary on the path.
Examples:
(On Windows with Cygwin) >
let g:patchreview_patch = 'c:\\cygwin\\bin\\patch.exe'
<
(On *nix systems) >
let g:patchreview_patch = '/usr/bin/gpatch'
<
*g:patchreview_patch_needs_crlf*
*patchreview_patch_needs_crlf*
g:patchreview_patch_needs_crlf = {1}
Optional flag to deal with patch command requiring DOS line endings in
patch files and diffs to work. Useful on Windows with UnxUtils patch.exe.
Example:
(On Windows with Cygwin) >
let g:patchreview_patch_needs_crlf = 1
<
*g:patchreview_wiggle*
*patchreview_wiggle*
g:patchreview_wiggle = {string}
Optional path to the wiggle ( http://linux.die.net/man/1/wiggle )
utility. If specified, |PatchReview| and |ReversePatchReview| commands
use it to create an addition diff when a review fails with some
conflicts/rejections.
Examples:
(On Windows with Cygwin) >
let g:patchreview_patch = 'c:\\cygwin\\bin\\patch.exe'
<
(On *nix systems) >
let g:patchreview_patch = '/usr/bin/gpatch'
<
Hooks *patchreview-hooks*
g:patchreview_prefunc = '{function}'
g:patchreview_postfunc = '{function}'
A function to be called before starting or finishing review
respectively. For example, the following example shows a way to use this
to create a way to get notifications when a long review finishes on a
Mac OS X machine. >
function MyNotify(review_type)
system('say "' . review_type . ' completed"')
endfunction
let g:patchreview_postfun = 'MyNotify'
<
Adding new version control plugins *patchreview-plugins*
New version control detection plugins can be written by the end user and
dropped in the autoload/patchreview/ directory. See existing plugins for
examples.
-------------------------------------------------------------------------------
vim: ft=help:ts=8:sts=8:sw=8:noexpandtab:tw=78:norl:
Jump to Line
Something went wrong with that request. Please try again.