<commit_before>
Building Android with SlothFS
=============================

[Slothfs](https://github.com/google/slothfs) is a FUSE file system that offers a
read-only view of a Git tree. It downloads files lazily, so it takes up less
diskspace than a full checkout based on `repo`. Once its caches are seeded,
creating fresh workspaces or syncing should take on the order of seconds.

It is developed as open source, and can be used by anyone that uses
Gerrit/Gitiles based Git hosting. The [design doc](design.md) explains the
background behind its design choices.

It has been tested on Linux, but we expect it works on OSX too.

For the remainder of this document, we will assume that you are trying to
compile some flavor of Android.


Installing
==========

Run `all.bash` to compile, test and install all components.  The rest of this
document assumes this has been done, and `$GOPATH/bin/` is in your `$PATH`.

In addition, install the standard Android `clone.json` to avoid unnecessary git
clones

    mkdir -p $HOME/.config/slothfs
    curl https://raw.githubusercontent.com/google/slothfs/master/android.json \
      >  $HOME/.config/slothfs/clone.json


Selecting the host
==================

The defaults of slothfs are for the public version of Android at
`android.googlesource.com`.  Set the `-gitiles_url` option to change against
which version of Android you want to run.


Dereferencing a manifest
========================
<commit_msg>Add a note about git2go/libgit2.<commit_after>
Building Android with SlothFS
=============================

[Slothfs](https://github.com/google/slothfs) is a FUSE file system that offers a
read-only view of a Git tree. It downloads files lazily, so it takes up less
diskspace than a full checkout based on `repo`. Once its caches are seeded,
creating fresh workspaces or syncing should take on the order of seconds.

It is developed as open source, and can be used by anyone that uses
Gerrit/Gitiles based Git hosting. The [design doc](design.md) explains the
background behind its design choices.

It has been tested on Linux, but we expect it works on OSX too.

For the remainder of this document, we will assume that you are trying to
compile some flavor of Android.


Installing
==========

Get the source code,

    go get github.com/google/slothfs/cmd/slothfs-multifs

SlothFS depends git2go, which depends on libgit2.  For git2go, we recommend
compiling libgit2 in statically, as documented
[here](https://github.com/libgit2/git2go#from-next).

To install all components, run

    cd $GOPATH/src/github.com/google/slothfs/ && sh all.bash

The rest of this document assumes this has been done, and `$GOPATH/bin/` is in
your `$PATH`.

In addition, install the standard Android `clone.json` to avoid unnecessary git
clones

    mkdir -p $HOME/.config/slothfs
    curl https://raw.githubusercontent.com/google/slothfs/master/android.json \
      >  $HOME/.config/slothfs/clone.json


Selecting the host
==================

The defaults of slothfs are for the public version of Android at
`android.googlesource.com`.  Set the `-gitiles_url` option to change against
which version of Android you want to run.


Dereferencing a manifest
========================

{'fraction_non_alphanumeric': 0.11321928460342146, 'fraction_numerical': 0.002488335925349922, 'mean_word_length': 4.229268292682927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 5, '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': '3546863', 'n_tokens_mistral': 933, 'n_tokens_neox': 893, 'n_words': 415}