NAME

cpangit-diff - compare two CPAN distributions, for reviewing an upgrade

NAME

cpangit-diff - compare two CPAN distributions, for reviewing an upgrade

USAGE

cpangit-diff [OPTIONS] MODULE::NAME
cpangit-diff [OPTIONS] FROM_DIST TO_DIST

The first form compares the distribution that provides a module in your branch with the distribution that provides it in one of the branch's import sources; in other words, it shows what you would get by upgrading that module.

The second form compares any two distributions. Each can be given as an author path like A/AU/AUTHOR/Example-1.02.tar.gz, as the name of a module (meaning the distribution that provides that module), or as the path of an archive file on disk.

The output starts with the changes to the declared prereqs, then the lines added to the change log, then a one-line summary of each changed file, and then a unified diff of each changed file. Files that are generated or binary are listed in the summary but have no diff. The output is meant to be equally useful to a person and to an automated reviewer.

OPTIONS

--git-dir=PATH

Path to the Git repository of CPAN::InGit. The default is GIT_DIR from the environment, or any git repo above "."

--branch=BRANCH_NAME

The branch in which to find FROM_DIST. The default is the checked-out branch.

--to-branch=BRANCH_NAME

The branch in which to find TO_DIST. The default is to look in --branch and then in each of its import sources. With a single MODULE::NAME argument, the default is the first import source that provides the module from a different distribution than --branch.

--format=text|json
--json

--json is the same as --format=json. The default is text. json writes the complete structure described in "compare" in CPAN::InGit::DistTree.

--stat

Omit the diffs of the files, leaving the prereqs, change log, and summary of files.

--full

Show the diff of every file, complete. This is the same as --include-generated --no-hide-version-diff --max-patch-size=0. Any of those given explicitly (such as --hide-version-diff or --max-patch-size=50000) takes precedence. Binary files still have no diff.

--path=PATH

Only compare files matching this path (or git pathspec) within the distributions. May be given more than once. This also enables the diffs of generated files.

--include-generated

Include the diffs of generated files: META.json, META.yml, MANIFEST, SIGNATURE, ppport.h, and everything under inc/.

--no-hide-version-diff

Show every change. By default, a change of a single line which mentions "version" and only replaces the version number of FROM_DIST with the version number of TO_DIST is left out of the diffs, because every module of a distribution usually has one or two of them. The summary of files says where they were left out.

--context=N

Number of unchanged lines to show around each change. Default 3.

--max-patch-size=BYTES

Omit the diff of any file whose diff is larger than this. Default 200000; 0 for no limit.

--no-fetch

Never download a distribution. By default, a distribution listed by a mirror branch but not yet stored in it is downloaded from the mirror's upstream. It is kept in a cache, and is not added to the mirror branch.

-v, --verbose
-q, --quiet

Show more or fewer log messages (on STDERR)

EXIT STATUS

0 if the comparison was made (whether or not there were differences), and nonzero if a distribution could not be found or read.

VERSION

version 0.007

AUTHOR

Michael Conrad <mike@nrdvana.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Michael Conrad, and IntelliTree Solutions.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.