Description

git-webrev generates HTML pages showing the differences between commits and/or the working tree (i.e. git-webrev is a kind of diff viewer). git-webrev can also include additional metadata in its HTML output, such as a link(s) to issue(s), link to the target repository etc. git-webrev is a Git port of the OpenJDK Code Tools project webrev.

Usage

$ git webrev -h
usage: git webrev [options] [<FILE>]
        -r, --rev REV                Compare against a specified base revision (alias for --base)
        -o, --output DIR             Output directory
        -u, --username NAME          Use specified username instead of 'guessing' one
            --upstream URL           The URL to the upstream repository
        -t, --title TITLE            The title of the webrev
        -c, --cr CR#                 Include link to the CR (aka bugid) in the main page
            --remote NAME            Use specified remote for calculating outgoing changes
            --base REV               Use specified revision as base for comparison
            --head REV               Use specified revision as head for comparison
        -s, --similarity SIMILARITY  Guess renamed files by similarity (0 - 100)
        -b,                          Do not ignore changes in whitespace (always true)
        -m, --mercurial              Deprecated: force use of mercurial
            --json                   Generate JSON instead of HTML
        -C, --no-comments            Do not show comments
        -N, --no-outgoing            Do not compare against remote, use only 'status'
            --verbose                Turn on verbose output
            --debug                  Turn on debugging output
        -v, --version                Print the version of this tool
        -h, --help                   Show this help text

Examples

Create a webrev with the outgoing changes for the current branch:

$ git webrev


Create a webrev with the changes between the worktree and HEAD:

$ git webrev -N


Create a webrev with the changes between commit C1 to commit C2:

$ git webrev --base=C1 --head=C2

Configuration

Configure the default name of the output directory to be "wdiff":

$ git configure --global webrev.output wdiff


Configure the username to always be "ehelin":

$ git configure --global webrev.username ehelin

Source

See GitWebrev.java.