aboutsummaryrefslogtreecommitdiff
path: root/doc/dev/index.rst
blob: 6932fa98eb90c859fdf7ac728d6b8a0279f78a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Developer docs
==============

Installation
************

.. note::

   Patchtree is developed and tested on \*NIX-like operating systems.
   Windows compatibility is not tested or guaranteed.
   The output .patch files can of course be used anywhere where ``git apply`` works.

Make sure you have the following dependencies installed:

* Python 3 and pip
* Coccinelle (optional)

Installation can be done by cloning this repository and running

.. code::

   $ pip install .

This will install any missing Python dependencies automatically as well.

Generating clean patches
************************

In order to generate a clean .patch file, patchtree needs

* the original source tree (either as a folder or .zip file)
* a list of patch files placed in the same structure as the original source tree

Writing patch sources
*********************



.. _config:

Configuration
*************

.. currentmodule:: patchtree.config

The configuration file is a Python file sourced from ``ptconfig.py`` relative to the current working directory when executing the ``patchtree`` command.
This file can contain arbitrary Python code.
Certain global variables influence the behavior of patchtree when defined.
These variables are the member variables of the :class:`Config` class.

Processors
**********

.. currentmodule:: patchtree.process

The processors included with patchtree are listed below.
Custom processors can be created by inheriting from the base :py:class:`Process` class and registering through the `configuration file <config_>`_.

.. toctree::
   :maxdepth: 1

   processor.rst

Diff engines
************

The diff engines included with patchtree are listed below.

.. toctree::
   :maxdepth: 1

   diff.rst