Add the GNU diff tool implementation.

Review Request #12600 — Created Sept. 14, 2022 and submitted — Latest diff uploaded

Information

RBTools
release-4.x

Reviewers

This introduces the first diff tool, GNUDiffTool. This wraps around
GNU Diff, properly checking search paths, building the correct command
line, and interpreting results.

If there are multiple diff executables found in the path, this will
end up checking each until it finds GNU Diff or exhausts all options.

The implementation handles all documented GNU Diff exit codes, providing
text vs. binary flags in the result (handling old legacy binary file
indicators) and all diff output.

This will be a step up from a lot of the GNU diff executions we
currently have in the codebase, and will let us remove a lot of
different forms of error handling, binary file support, and execute name
determination.

Unit tests passed.

Tested this with some in-progress changes to switch SCMClients over. They
successfully ran GNU Diff and handled the results.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

orig
1
2

Commits

First Last Summary ID Author
Add the GNU diff tool implementation.
This introduces the first diff tool, `GNUDiffTool`. This wraps around GNU Diff, properly checking search paths, building the correct command line, and interpreting results. If there are multiple `diff` executables found in the path, this will end up checking each until it finds GNU Diff or exhausts all options. The implementation handles all documented GNU Diff exit codes, providing text vs. binary flags in the result (handling old legacy binary file indicators) and all diff output. This will be a step up from a lot of the GNU diff executions we currently have in the codebase, and will let us remove a lot of different forms of error handling, binary file support, and execute name determination.
3b9cb6438fa355c3431a2fe0d38209ef549112ad Christian Hammond
docs/rbtools/api/coderef/index.rst
rbtools/diffs/tests/test_gnu_diff_tool.py
rbtools/diffs/tools/backends/__init__.py
rbtools/diffs/tools/backends/gnu.py
Loading...