Skip to main content

A unison wrapper to integrate with .gitignore

Project description

Unison Gitignore

PyPI version

A gitignore-aware wrapper around Unison

unison-gitignore will walk the local root and any supplied paths finding gitignore files and then call unison with the appropriate unison ignore patterns

Usage

First install it:

pip install unison-gitignore

Then use:

unison-gitignore /home/john_doe/local_root ssh://remote_root/ -path data

It accepts the exact same arguments as unison

Caveats

  • Will not add patterns when using two local roots:

    Unison does the match without the root attached, so a .gitignore file in either root would apply to both local roots

  • Will not add patterns when profile usage method is used

  • Does not handle !pattern in the same way as git does:

    b/
    !b/c/test.py
    

    test.py will not be ignored in git, but will be ignored by unison

    The Unison reference says this:

    Unison starts detecting updates from the root of the replicas—i.e., from the empty path. If the empty path matches an ignore pattern and does not match an ignorenot pattern, then the whole replica will be ignored. (For this reason, it is not a good idea to include Name * as an ignore pattern. If you want to ignore everything except a certain set of files, use Name ?*.)

    If the root is a directory, Unison continues looking for updates in all the immediate children of the root. Again, if the name of some child matches an ignore pattern and does not match an ignorenot pattern, then this whole path including everything below it will be ignored.

    If any of the non-ignored children are directories, then the process continues recursively.

    So any negated files or directories that are not direct children of an ignored directory will be ignored improperly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unison-gitignore-1.0.5.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

unison_gitignore-1.0.5-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page