Skip to main content

bolthole

Project description

bolthole

Automatically backup changes to a directory to git.

Usage

bolthole
    [--ignore GLOB [--ignore ...]]          # autoignored: .git, .gitignore
    [--author AUTHOR] [--message TEXT]      # override your git config
    [--grace SECONDS] [--bundle SECONDS]    # allow for rapid edits to finish
    [--remote NAME [--remote ...]]          # push changes upstream
    [--verbose] [--show-git] [--timeless]
        [--watchdog-debug]                  # control verbosity
    [--dry-run]                             # test it first
    [--once]                                # no ongoing monitoring
    source_dir                              # what to monitor
    [dest_dir]                              # optionally copy to repo

Autocommit a directory

bolthole .

Assumes the directory is already git controlled, and will refuse to start if not. It will commit any outstanding changes. If --once was used, it will then stop, otherwise it will watch for changes until killed, committing them.

Autocommit to a different directory

bolthole project/ pristine-copy/

If pristine-copy doesn't exist, it will copy it and create a git repository there, or it will check that if directory is already git controlled and will refuse to start if not. It will commit any outstanding changes. If --once was used, it will then stop, otherwise it will watch for changes until killed, committing them.

Grace and bundling

The --grace SECONDS option will wait until the amount of time specified has passed before committing the file, and will restart the timer after each change. This way, if a file is being edited repeatedly in a short span of time, the result would be only one commit, not many.

The --bundle SECONDS option allows for multiple file changes to be bundled together in one commit rather than one commit per file, as long as they all happened at roughly the same time. The bundle time is how recently a file needs to have been changed in order to be excluded from the bundle.

For example, with a grace period of five minutes, and a bundle window of one minute:

  • at t = 0m00sfoo.txt is edited, and a timer for it is set for 300 seconds
  • at t = 0m30sbar.txt is edited, and a timer for it is set for 300s (we now have foo.txt at 270s, bar.txt at 300s)
  • at t = 4m30sbaz.txt is edited, and a timer for it is set for 300s (we now have foo.txt at 30s, bar.txt at 60s, baz.txt at 300s)
  • at t = 5m00s — the foo.txt timer goes off (we now have foo.txt at 0s, bar.txt at 30s, baz.txt at 270s); the changes to foo.txt and bar.txt were both made earlier than the bundle window, and one commit is made with both changes
  • at t = 9m30sbaz.txt is committed

Installation

Bolthole is installed from pypi:

pip install bolthole

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

bolthole-1.0.1.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bolthole-1.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file bolthole-1.0.1.tar.gz.

File metadata

  • Download URL: bolthole-1.0.1.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bolthole-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e10b5de35e24de7f931719ff86df291eab9dff6f8f3751658ebbc1f43bf52827
MD5 af97e3b47341e1d7f5bf790f57b1423a
BLAKE2b-256 db33e4a945164d11c7efc1b1bf6dfc3c6c9b1b1f991914a00da0d9095422d380

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolthole-1.0.1.tar.gz:

Publisher: publish.yml on norm/bolthole

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bolthole-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: bolthole-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bolthole-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9c069087eb47395dd931b8c8adc3138f9392b21a28d1c3aa1017c9e599fbde6
MD5 ede8cf3af00fef08f4f3242d100a326e
BLAKE2b-256 e36741d46d60376b247601507019f895a2816003238682a9a45ae21e514c0bd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolthole-1.0.1-py3-none-any.whl:

Publisher: publish.yml on norm/bolthole

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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