Metadata-Version: 2.4
Name: secretside
Version: 0.2.1
Summary: Shift git commit timestamps out of work hours so your side project stays secret
Project-URL: Homepage, https://codeberg.org/magicalhack/secretside
Project-URL: Repository, https://codeberg.org/magicalhack/secretside
Project-URL: Issues, https://codeberg.org/magicalhack/secretside/issues
Author-email: magicalhack <hello@magicalhack.net>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.11
Requires-Dist: click>=8.2.1
Requires-Dist: git-filter-repo>=2.47.0
Requires-Dist: holidays>=0.80
Requires-Dist: pygit2>=1.18.2
Requires-Dist: rich>=14.0.0
Description-Content-Type: text/markdown

# secretside

Shift git commit timestamps out of work hours so your side project stays secret.

If you committed at 10:47 on a Wednesday, secretside moves it to 17:47 (or later). It also catches identity leaks — commits made with your real name or work email when you meant to use a pseudonym.

## Install

```bash
pip install secretside
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv tool install secretside
```

<small>Note: `libgit2` 1.9 headers are required.</small>

## Quick start

```bash
secretside init
secretside clean --dry-run
secretside check # quick validate for use in a git hook
```

## Commands

**`secretside init [repo] [--country XX] [--force]`** — Generate `secretside.toml` with jittered defaults so every project's config looks slightly different.

**`secretside clean [repo] [--dry-run]`** — Preview and apply timestamp shifts. Only touches your most recent contiguous commits. With `local_only = true` in your config (the default), only unpushed commits are considered/modified.

**`secretside inspect [repo]`** — Show commit time distribution and list all work-hour commits.

**`secretside check [repo]`** — Validate that no commits fall in work hours and no banned identities appear. Designed for CI or pre-push hooks.

## Config

`secretside init` creates a `secretside.toml` in your repo:

```toml
holidays = "CA"
work_days = "mon-fri"
work_hours = "08:47..17:52"
night_hours = "23:12..05:44"
local_only = true
banned = [
    # ["Your Real Name", "real@email.com"],
    # ["Your Real Name", "work@company.com"],
]
pto = [
    # "2025-02-07",
    # "2025-12-24..2025-12-31",
]
```

| Key | Description |
|-----|-------------|
| `holidays` | Country code for public holidays (`"CA"`, `"US"`, `"GB"`, etc.) |
| `work_days` | Which days are work days (`"mon-fri"`, `"mon-thu"`, `"mon-wed,fri"`) |
| `work_hours` | Commits in this range on work days get shifted past `work_end` |
| `night_hours` | Shifted commits avoid landing here (organic night commits are left alone) |
| `local_only` | Only shift commits that haven't been pushed to any remote |
| `banned` | Name/email pairs to flag in `check` — keep your real identity out of the repo |
| `pto` | Dates (or `start..end` ranges) to treat as days off |

## How it works

- Only the **contiguous tail** of your commits is touched — other people's commits are never modified
- **Weekend, holiday, and PTO commits** are left alone — already safe - unless they need shifting due to overflow from a work day
- **Organic night commits** (you actually coded at 1am) stay put
- **Chronological order** is always preserved, with original time gaps maintained where possible
- History rewriting uses [git-filter-repo](https://github.com/newren/git-filter-repo) under the hood

## Development

Requires Python 3.11+ and [uv](https://docs.astral.sh/uv/).

```bash
uv sync
bin/test
uv run secretside <command>
```
