<commit_before>== Installation:

Install the python library and git porcelain script
$ sudo python setup.py install

Then link the porcelain into git-core
$ sudo sapling.py --install

Get help
$ git sap -h

== Development:

To run all tests, you can use something like:
$ PYTHONPATH=$PYTHONPATH:. py.test test/*.py -v
<commit_msg>Add some docs on the .saplings config file.<commit_after>== Installation:

Install the python library and git porcelain script
$ sudo python setup.py install

Then link the porcelain into git-core
$ sudo sapling.py --install

Get help
$ git sap -h

== Configuration

Sapling (git sap) is configured with a .saplings file at the root of your git repository.  Here's
an example .saplings configuration for a scala project with common component and a hack component
that uses it:

common = {
  # The logical name of the split - listed by git sap.
  'name': 'common',

  # The default remote to associate this split with - currently ignored but required.
  'remote': 'file:/tmp/common.git',

  # The paths that comprise this split.  These paths will form the saplings split from and merged
  # into your repository when using git sap --split and git sap --merge respectively
  'paths': [
    'project',
    'src/main/scala/com/twitter/common',
    'src/main/resources/com/twitter/common',
    'src/test/scala/com/twitter/common',
  ]
}

hack = {
  'name': 'hack',
  'remote': 'file:/tmp/hack.git',
  'paths': [
    'project',
    'src/main/scala/com/twitter/hack',
  ]
}

# This is all git sap looks for - a list of splits named 'splits'.  Each split in the list must be
# a dict with the keys shown/described above.
splits = [
  common,
  hack
]

== Development:

To run all tests, you can use something like:
$ PYTHONPATH=$PYTHONPATH:. py.test test/*.py -v

{'fraction_non_alphanumeric': 0.10196078431372549, 'fraction_numerical': 0.0, 'mean_word_length': 3.487437185929648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3036736', 'n_tokens_mistral': 568, 'n_tokens_neox': 551, 'n_words': 226}