Linux command
interdiff 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show differences between two patches
interdiff [old.patch] [new.patch]
Create a patch to convert
interdiff [version1.patch] [version2.patch] > [upgrade.patch]
Strip leading path components
interdiff -p 1 [old.patch] [new.patch]
Display additional lines of context
interdiff -U [3] [old.patch] [new.patch]
Compare gzip/bzip2 compressed patches
interdiff -z [old.patch.gz] [new.patch.gz]
说明
interdiff compares two unified diff files (patches) and generates a diff representing the changes between them. This is useful for understanding what changed between two versions of a patch or for creating incremental patches. Given patch1 that transforms A to B, and patch2 that transforms A to C, interdiff produces a patch that transforms B to C. This helps when reviewing patch revisions or creating upgrade paths between software versions.
参数
- -U _N_, --unified=_N_
- Display N lines of context (default: 3).
- -p _N_, --strip-match=_N_
- Ignore N leading pathname components when matching filenames.
- -d _PAT_, --drop-context=_PAT_
- Exclude context for files whose names match pattern PAT.
- -i, --ignore-case
- Treat upper and lower case as identical when comparing.
- -w, --ignore-all-space
- Ignore all whitespace when comparing.
- -b, --ignore-space-change
- Ignore changes in the amount of whitespace.
- -B, --ignore-blank-lines
- Ignore changes that consist only of blank-line additions/removals.
- -z, --decompress
- Automatically decompress .gz and .bz2 patches.
- -q, --quiet
- Reduce warnings in output.
- --no-revert-omitted
- Do not revert portions of the first patch that are omitted from the second.
- --help
- Display usage information.
- --version
- Show version number.
FAQ
What is the interdiff command used for?
interdiff compares two unified diff files (patches) and generates a diff representing the changes between them. This is useful for understanding what changed between two versions of a patch or for creating incremental patches. Given patch1 that transforms A to B, and patch2 that transforms A to C, interdiff produces a patch that transforms B to C. This helps when reviewing patch revisions or creating upgrade paths between software versions.
How do I run a basic interdiff example?
Run `interdiff [old.patch] [new.patch]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -U _N_, --unified=_N_ do in interdiff?
Display N lines of context (default: 3).