Skip to main content

Per-session checkpoint using git-stash-create

Project description

TravisCI PyPI PyPI-License

PSCP: Per-session checkpoint

PSCP is a brand-new way to make checkpoint in git repository efficiently. By logging the hash output by pscp.create(), you can git diff, git stash branch and git checkout using them whenever you want. PSCP is framework-agnostic, so can be used in any git repository.

PSCP inherits all strengths from git, which are very useful for study.

  • Recycle unchanged objects
  • Compression (zlib)
  • Show differences using git diff a..b
  • Checkout to, using git checkout
  • Create branch from, using git stash branch. This restores staged files staged and unstaged files unstaged.

Besides, PSCP does make neither git log nor git stash list messy. You won't suffer from trivial tuning commits and too many stashes.

Requirements

  • python 3.5+
  • git

Installation

pip install pscp

Getting Started (with tensorboardX)

Getting Started

How does it work?

How It Works

Tracking New Files

Use git add to stage, to track new files. Untracked files will not be added to the checkpoint.

Command Line Tool (TODO)

python -m pscp

pscp.create(return_head_on_nothing=True, return_format='abbrev', link=True)

Create per-session checkpoint.

  • return_head_on_nothing: If True, return hash of HEAD when there are nothing changed compared to HEAD, otherwise, return None.
  • return_format
    • abbrev, short: Return abbreviated hash.
    • long: Return just unabbreviated hash.
    • ref: Return refspec. Raises exception when link == False.
  • link: See pscp.link() below.

pscp.link(hash)

Create reference named refs/pscp/{timestamp_ms}. It could be used to avoid pruning on garbage collection.

pscp.delete(refspec)

Delete pscp reference. Call pscp.gc() if you want.

  • refspec: Target refspec to be deleted. timestamp_ms is also allowed.

pscp.gc(prune='now')

Run git gc --prune=<prune>.

pscp.push(refspec=None, repository='origin')

Push checkpoint to the remote repository.

  • refspec: If None, all checkpoints are pushed.

pscp.fetch(refspec=None, refmap=None, repository='origin')

  • refspec: If None, all checkpoints are fetched.
  • refmap: If None, refs/pscp/*:refs/pscp/* is used.

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

pscp-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file pscp-0.0.2.tar.gz.

File metadata

  • Download URL: pscp-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for pscp-0.0.2.tar.gz
Algorithm Hash digest
SHA256 56e54dd8eaac8bcbb0bc32074a39a181d24cc74735c7573c54cd8cc7de717058
MD5 ebdbc80bdd75e469def46f2271442259
BLAKE2b-256 7e3e3541bd812a83d3a48e4a384a8e21347743aeec2917f9b4834e5c4493c834

See more details on using hashes here.

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