{
    "mode": "man",
    "parameter": "patchview",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/patchview/1/json",
    "generated": "2026-08-17T18:06:06Z",
    "synopsis": "patchview [[-n] | [--line-number]] [[-p n] | [--strip-match=n]] [--strip=n]\n[--addprefix=PREFIX] [[-s] | [--status]] [[-E] | [--empty-files-as-removed]]\n[[-i PATTERN] | [--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-z] |\n[--decompress]] [[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] |\n[--files=RANGE]] [[-H] | [--with-filename]] [[-h] | [--no-filename]] [[-v] |\n[--verbose]...] [file...]\npatchview {[--help] | [--version] | [--filter ...] | [--grep ...]}",
    "sections": {
        "NAME": {
            "content": "patchview - Without options, show numbered files modified by the patch. With options, behave\nas filterdiff.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "patchview [[-n] | [--line-number]] [[-p n] | [--strip-match=n]] [--strip=n]\n[--addprefix=PREFIX] [[-s] | [--status]] [[-E] | [--empty-files-as-removed]]\n[[-i PATTERN] | [--include=PATTERN]] [[-x PATTERN] | [--exclude=PATTERN]] [[-z] |\n[--decompress]] [[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] |\n[--files=RANGE]] [[-H] | [--with-filename]] [[-h] | [--no-filename]] [[-v] |\n[--verbose]...] [file...]\n\npatchview {[--help] | [--version] | [--filter ...] | [--grep ...]}\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "So what is patchview? It is a wrapper of filterdiff for use with numbered files.\n\npatchview\n\n(without args) is equivalent to: lsdiff --number\n\npatchview -F2-\n\n(or with any other args) is equivalent to: filterdiff -F2- (or whatever arguments are\nsupplied)\n\nThere are two scripts for working with git (gitdiff and gitdiffview) and two for svn (svndiff\nand svndiffview).\n\nsvndiff\n\n\n\ngitdiff\n\n(without args) will give the list of files modified\n\nsvndiff -F1\n\n\n\ngitdiff -F1\n\nwill show the patch of file #1\n\nsvndiffview\n\n\n\ngitdiffview\n\npipe all patches through filterdiff to vim - -R (in read-only mode, easy to quit), showing\ncomplete patch with color.\n\nsvndiffview -F2\n\n\n\ngitdiffview -F2\n\n(or any other args) will pipe patch of file #2 to vim - -R\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-n --line-number",
                    "content": "Display the line number that each patch begins at. If verbose output is requested (using\n-nv), each hunk of each patch is listed as well.\n\nFor each file that is modified, a line is generated containing the line number of the\nbeginning of the patch, followed by a Tab character, followed by the name of the file\nthat is modified. If -v is given once, following each of these lines will be one line for\neach hunk, consisting of a Tab character, the line number that the hunk begins at,\nanother Tab character, the string “Hunk #”, and the hunk number (starting at 1).\n\nIf the -v is given twice in conjunction with -n (i.e.  -nvv), the format is slightly\ndifferent: hunk-level descriptive text is shown after each hunk number, and the\n--number-files option is enabled.\n",
                    "flag": "-n",
                    "long": "--line-number"
                },
                {
                    "name": "-N --number-files",
                    "content": "File numbers are listed, beginning at 1, before each filename.\n\n-# RANGE, --hunks=RANGE\nOnly list hunks within the specified RANGE. Hunks are numbered from 1, and the range is a\ncomma-separated list of numbers or “first-last” spans, optionally preceded by a modifier\n'x' which inverts the entire range; either the first or the last in the span may be\nomitted to indicate no limit in that direction.\n\n--lines=RANGE\nOnly list hunks that contain lines from the original file that lie within the specified\nRANGE. Lines are numbered from 1, and the range is a comma-separated list of numbers or\n“first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range;\neither the first or the last in the span may be omitted to indicate no limit in that\ndirection.\n",
                    "flag": "-N",
                    "long": "--number-files"
                },
                {
                    "name": "-F --files",
                    "content": "Only list files indicated by the specified RANGE. Files are numbered from 1 in the order\nthey appear in the patch input, and the range is a comma-separated list of numbers or\n“first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range;\neither the first or the last in the span may be omitted to indicate no limit in that\ndirection.\n",
                    "flag": "-F",
                    "long": "--files"
                },
                {
                    "name": "-p _ --strip-match=_",
                    "content": "When matching, ignore the first n components of the pathname.\n\n--strip=n\nRemove the first n components of the pathname before displaying it.\n\n--addprefix=PREFIX\nPrefix the pathname with PREFIX before displaying it.\n",
                    "flag": "-p",
                    "long": "--strip-match",
                    "arg": "_"
                },
                {
                    "name": "-s --status",
                    "content": "Show file additions, modifications and removals. A file addition is indicated by a “+”, a\nremoval by a “-”, and a modification by a “!”.\n",
                    "flag": "-s",
                    "long": "--status"
                },
                {
                    "name": "-E --empty-files-as-removed",
                    "content": "Treat empty files as absent for the purpose of displaying file additions, modifications\nand removals.\n",
                    "flag": "-E",
                    "long": "--empty-files-as-removed"
                },
                {
                    "name": "-i _ --include=_",
                    "content": "Include only files matching PATTERN.\n",
                    "flag": "-i",
                    "long": "--include",
                    "arg": "_"
                },
                {
                    "name": "-x _ --exclude=_",
                    "content": "Exclude files matching PATTERN.\n",
                    "flag": "-x",
                    "long": "--exclude",
                    "arg": "_"
                },
                {
                    "name": "-z --decompress",
                    "content": "Decompress files with extensions .gz and .bz2.\n",
                    "flag": "-z",
                    "long": "--decompress"
                },
                {
                    "name": "-H --with-filename",
                    "content": "Print the name of the patch file containing each patch.\n",
                    "flag": "-H",
                    "long": "--with-filename"
                },
                {
                    "name": "-h --no-filename",
                    "content": "Suppress the name of the patch file containing each patch.\n",
                    "flag": "-h",
                    "long": "--no-filename"
                },
                {
                    "name": "-v --verbose",
                    "content": "Verbose output.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "--help",
                    "content": "Display a short usage message.\n",
                    "long": "--help"
                },
                {
                    "name": "--version",
                    "content": "Display the version number of patchview.\n",
                    "long": "--version"
                },
                {
                    "name": "--filter",
                    "content": "Behave like filterdiff(1) instead.\n",
                    "long": "--filter"
                },
                {
                    "name": "--grep",
                    "content": "Behave like grepdiff(1) instead.\n",
                    "long": "--grep"
                }
            ]
        },
        "SEE ALSO": {
            "content": "lsdiff(1),filterdiff(1), grepdiff(1)\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "We can make the following one-line script with the name difftotrunk.sh, to view the\ndifferences of two directories or svn repos (trunk and .)\n\ndiff ../trunk . -ru -x .svn | patchview \"$@\"\n\n./difftotrunk.sh , will show all different files and his number.\n\n\n\n./difftotrunk.sh -F3,4 , will show the differences of files #3 and #4 only.\n\n\n\n./difftotrunk.sh -F3 -#1 , will show only hunk #1 of file #3.\n\n\n\n./difftotrunk.sh -F3 -#x1 , will show the differences of files #3 without hunk #1 (x means that exclude).\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Tim Waugh <twaugh@redhat.com>\nPackage maintainer\n\npatchutils                                   02 Jul 2020                                PATCHVIEW(1)",
            "subsections": []
        }
    },
    "summary": "patchview - Without options, show numbered files modified by the patch. With options, behave as filterdiff.",
    "flags": [
        {
            "flag": "-n",
            "long": "--line-number",
            "arg": null,
            "description": "Display the line number that each patch begins at. If verbose output is requested (using -nv), each hunk of each patch is listed as well. For each file that is modified, a line is generated containing the line number of the beginning of the patch, followed by a Tab character, followed by the name of the file that is modified. If -v is given once, following each of these lines will be one line for each hunk, consisting of a Tab character, the line number that the hunk begins at, another Tab character, the string “Hunk #”, and the hunk number (starting at 1). If the -v is given twice in conjunction with -n (i.e. -nvv), the format is slightly different: hunk-level descriptive text is shown after each hunk number, and the --number-files option is enabled."
        },
        {
            "flag": "-N",
            "long": "--number-files",
            "arg": null,
            "description": "File numbers are listed, beginning at 1, before each filename. -# RANGE, --hunks=RANGE Only list hunks within the specified RANGE. Hunks are numbered from 1, and the range is a comma-separated list of numbers or “first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range; either the first or the last in the span may be omitted to indicate no limit in that direction. --lines=RANGE Only list hunks that contain lines from the original file that lie within the specified RANGE. Lines are numbered from 1, and the range is a comma-separated list of numbers or “first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range; either the first or the last in the span may be omitted to indicate no limit in that direction."
        },
        {
            "flag": "-F",
            "long": "--files",
            "arg": null,
            "description": "Only list files indicated by the specified RANGE. Files are numbered from 1 in the order they appear in the patch input, and the range is a comma-separated list of numbers or “first-last” spans, optionally preceded by a modifier 'x' which inverts the entire range; either the first or the last in the span may be omitted to indicate no limit in that direction."
        },
        {
            "flag": "-p",
            "long": "--strip-match",
            "arg": "_",
            "description": "When matching, ignore the first n components of the pathname. --strip=n Remove the first n components of the pathname before displaying it. --addprefix=PREFIX Prefix the pathname with PREFIX before displaying it."
        },
        {
            "flag": "-s",
            "long": "--status",
            "arg": null,
            "description": "Show file additions, modifications and removals. A file addition is indicated by a “+”, a removal by a “-”, and a modification by a “!”."
        },
        {
            "flag": "-E",
            "long": "--empty-files-as-removed",
            "arg": null,
            "description": "Treat empty files as absent for the purpose of displaying file additions, modifications and removals."
        },
        {
            "flag": "-i",
            "long": "--include",
            "arg": "_",
            "description": "Include only files matching PATTERN."
        },
        {
            "flag": "-x",
            "long": "--exclude",
            "arg": "_",
            "description": "Exclude files matching PATTERN."
        },
        {
            "flag": "-z",
            "long": "--decompress",
            "arg": null,
            "description": "Decompress files with extensions .gz and .bz2."
        },
        {
            "flag": "-H",
            "long": "--with-filename",
            "arg": null,
            "description": "Print the name of the patch file containing each patch."
        },
        {
            "flag": "-h",
            "long": "--no-filename",
            "arg": null,
            "description": "Suppress the name of the patch file containing each patch."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Verbose output."
        },
        {
            "flag": "",
            "long": "--help",
            "arg": null,
            "description": "Display a short usage message."
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "Display the version number of patchview."
        },
        {
            "flag": "",
            "long": "--filter",
            "arg": null,
            "description": "Behave like filterdiff(1) instead."
        },
        {
            "flag": "",
            "long": "--grep",
            "arg": null,
            "description": "Behave like grepdiff(1) instead."
        }
    ],
    "examples": [
        "We can make the following one-line script with the name difftotrunk.sh, to view the",
        "differences of two directories or svn repos (trunk and .)",
        "diff ../trunk . -ru -x .svn | patchview \"$@\"",
        "./difftotrunk.sh , will show all different files and his number.",
        "./difftotrunk.sh -F3,4 , will show the differences of files #3 and #4 only.",
        "./difftotrunk.sh -F3 -#1 , will show only hunk #1 of file #3.",
        "./difftotrunk.sh -F3 -#x1 , will show the differences of files #3 without hunk #1 (x means that exclude)."
    ],
    "see_also": [
        {
            "name": "lsdiff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/lsdiff/1/json"
        },
        {
            "name": "filterdiff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/filterdiff/1/json"
        },
        {
            "name": "grepdiff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/grepdiff/1/json"
        }
    ]
}