datalad.plugin.no_annex

configure which dataset parts to never put in the annex

datalad.plugin.no_annex.dlplugin(dataset, pattern, ref_dir='.', makedirs='no')[source]

Configure a dataset to never put some content into the dataset’s annex

This can be useful in mixed datasets that also contain textual data, such as source code, which can be efficiently and more conveniently managed directly in Git.

Patterns generally look like this:

code/*

which would match all file in the code directory. In order to match all files under code/, including all its subdirectories use such a pattern:

code/**

Note that the plugin works incrementally, hence any existing configuration (e.g. from a previous plugin run) is amended, not replaced.

Parameters:
  • dataset (Dataset) – dataset to configure
  • pattern (list) – list of path patterns. Any content whose path is matching any pattern will not be annexed when added to a dataset, but instead will be tracked directly in Git. Path pattern have to be relative to the directory given by the ref_dir option. By default, patterns should be relative to the root of the dataset.
  • ref_dir (str, optional) – Relative path (within the dataset) to the directory that is to be configured. All patterns are interpreted relative to this path, and configuration is written to a .gitattributes file in this directory.
  • makedirs (bool, optional) – If set, any missing directories will be created in order to be able to place a file into ref_dir. Default: False.