|
| 1 | +========= |
| 2 | +Deltacode |
| 3 | +========= |
| 4 | + |
| 5 | + +--------------+----------------------------------------------------------------------------------------------+ |
| 6 | + | **Branch** | **Linux (Travis)** | |
| 7 | + +--------------+----------------------------------------------------------------------------------------------+ |
| 8 | + | develop |.. image:: https://travis-ci.com/nexB/deltacode.svg?token=9MXbiHv3xZxwT2egFxby&branch=develop | |
| 9 | + | | :target: https://travis-ci.com/nexB/deltacode | |
| 10 | + +--------------+----------------------------------------------------------------------------------------------+ |
| 11 | + |
| 12 | +About: |
| 13 | +====== |
| 14 | + |
| 15 | +``deltacode`` is a simple command line utility that leverages the power |
| 16 | +of `scancode-toolkit <https://github.com/nexB/scancode-toolkit>`_ to determine file-level differences between two |
| 17 | +codebases. |
| 18 | + |
| 19 | +How to use: |
| 20 | +=========== |
| 21 | + |
| 22 | +In order to calculate these differences (i.e. 'deltas'), the user must have two individual |
| 23 | +scancode scan files, with the ``--info`` scan option at minimum. |
| 24 | + |
| 25 | +For example:: |
| 26 | + |
| 27 | + $ pip install scancode-toolkit |
| 28 | + $ scancode --info ~/postgresql-9.6/ ~/psql-9.6-fileinfo.json |
| 29 | + $ scancode --info ~/postgresql-10.0/ ~/psql-10.0-fileinfo.json |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +Once you have the two codebase scans, simply install/configure |
| 34 | +deltacode, and run it on the two scans:: |
| 35 | + |
| 36 | + (deltacode) $ deltacode --help |
| 37 | + Usage: deltacode [OPTIONS] |
| 38 | + |
| 39 | + Identify the changes that need to be made to the 'old' scan file (-o or |
| 40 | + --old) in order to generate the 'new' scan file (-n or --new). Write the |
| 41 | + results to a .csv file (-c or --csv-file) or a .json file (-j or --json- |
| 42 | + file) at a user-designated location. If no file option is selected, print |
| 43 | + the JSON results to the console. |
| 44 | + |
| 45 | + Options: |
| 46 | + -h, --help Show this message and exit. |
| 47 | + -n, --new PATH Identify the path to the "new" scan file |
| 48 | + [required] |
| 49 | + -o, --old PATH Identify the path to the "old" scan file |
| 50 | + [required] |
| 51 | + -c, --csv-file PATH Identify the path to the .csv output file |
| 52 | + -j, --json-file FILENAME Identify the path to the .json output file |
| 53 | + -a, --all-delta-types Include unmodified files as well as all changed |
| 54 | + files in the .json or .csv output. If not |
| 55 | + selected, only changed files are included. |
| 56 | + |
| 57 | + (deltacode) $ deltacode -n ~/psql-10.0-fileinfo.json -o ~/psql-9.6-fileinfo.json -j ~/psql-10.0-psql-9.6-delta.json |
| 58 | + |
| 59 | +========= |
| 60 | +Problems? |
| 61 | +========= |
| 62 | + |
| 63 | +Open an `issue <https://www.github.com/nexb/deltacode/issues>`_. |
| 64 | + |
| 65 | +Notes: |
| 66 | +====== |
| 67 | + |
| 68 | +- ``deltacode`` also collects statistical information, like # of files and other percentages. Currently, this output is not present in the ``csv`` output |
| 69 | + |
| 70 | +Future TODOs/additions: |
| 71 | +======================= |
| 72 | + |
| 73 | +- Use ``copyright`` information from scans to identify changes in copyright holders or dates for attribution. |
| 74 | +- Detect package or file changes that are only a version change for the same package or file. |
| 75 | +- Determine whether some added/removed files or packages are actually cases where the files or packages were moved. |
| 76 | + |
0 commit comments