Git Product home page Git Product logo

dotbot-autobot's Introduction

Inspired by anishathalye/dotbot#91

Requirements

  • A Git repository
  • A Dotbot configuration file in that repository
  • Python 3

There are non-Python dependencies for this tool. On Debian Jessie, you can install them with:

apt-get install libgit2-dev python3-cffi python3-yaml

and on OSX/macOS:

brew install libgit2 libyaml python-cffi

Then install the Python requirements:

pip install -r requirements.txt

You can also use this technique to configure a virtualenv or pyenv-virtualenv for this, once you have found the full path to the executable.

Usage instructions

Save pre-commit and prepare-commit-msg to .git/hooks in your dotfiles directory. Alternatively, use a Git hook manager.

Then when a file is added to the index and committed, your Dotbot configuration file will be updated with a new "link" entry:

link:
    ~/.filename: filename

If your Python executable has a name other than Python (e.g. python3 or python3.5, or if you are using a virtualenv) you could use a wrapper script with the correct executable:

#! /usr/bin/env sh
python3.5 pre-commit.py "$@"

Options

Options are configurable through environment variables:

  • AUTOBOT_DISABLED: If this is non-empty, these hooks do nothing (default is empty).
  • AUTOBOT_REPO_ROOT: Set the root directory for the repository (default is .).
  • AUTOBOT_DOTBOT_CONF: Set an alternative name for your Dotbot config file (default is install.conf.yaml).
  • AUTOBOT_INCLUDE: Colon-separated list of files or directories files to exclude (default is the value of $AUTOBOT_REPO_ROOT). Basic wildcards (*, **, ?, [abc], and [!abc]) are allowed. Paths are first expanded using glob.glob(), and then matched using Path.match(), both in the Python standard library.
  • AUTOBOT_EXCLUDE: Same notes as above. The exclusion check is applied after the inclusion check.
  • AUTOBOT_DELETE_BACKUP: If this is non-empty, delete the backup file when finished (not recommended).
  • AUTOBOT_DEBUG: If this is non-empty, activate extremely verbose debug-level logging.

Missing features

  • Wildcard include/exclude
  • Gitignore parsing

Troubleshooting

  • make sure you've installed the latest matching versions of cffi and pygit2
  • make sure you have the correct shebang at the top of the hook scripts

dotbot-autobot's People

Contributors

davidawad avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.