Skip to main content

A Git-like Version Control System in Python

Project description

Kingnstar VCS 🚀

A Git-like Version Control System written in pure Python. Installable via pip, usable via CLI.

Features

Explicit, Deterministic Logic — No magic defaults
Content-Addressed Storage — SHA-1 immutable objects
Password-Protected Branches — With master password override
Simple Cherry-Pickingkingnstar pull <branch> <commit_id>
No Complex Merging — Just explicit file override

Installation

pip install kingnstar

Quick Start

# Initialize repository
kingnstar start

# Create and stage files
echo "Hello" > hello.txt
kingnstar add hello.txt

# Commit
kingnstar commit -m "Initial commit"

# Check status
kingnstar status

# Create protected branch
kingnstar new branch dev

# Switch branch
kingnstar switch dev MyPassword

# Pull commit from another branch
kingnstar pull master <commit_hash>

Commands

kingnstar start

Initialize a new Kingnstar repository (idempotent).

kingnstar add <pattern1> [<pattern2> ...]

Stage files matching glob patterns.

kingnstar add file.py
kingnstar add src/*.py
kingnstar add src/** tests/**

kingnstar commit -m "message"

Create commit from staged files.

kingnstar commit -m "Add new feature"

kingnstar branch

List all branches.

kingnstar branch

kingnstar new branch <name>

Create password-protected branch.

kingnstar new branch feature
# Prompts for password twice

kingnstar switch <branch> [password]

Switch to branch (requires password for protected branches).

kingnstar switch master              # No password needed
kingnstar switch dev MyPassword123   # With password
# Master password: Kingnstar@1604 (recovery option)

kingnstar status

Show current branch, commit, and staged files.

kingnstar pull <branch> <commit_id>

Cherry-pick commit from another branch (with conflict detection).

kingnstar pull dev abc123def456...
# Asks for confirmation if files conflict

Storage Model

All objects stored in .kingnstar/ hidden directory:

.kingnstar/
├── HEAD                 # Current branch pointer
├── index               # Staging area
├── objects/            # Content-addressed storage
│   ├── 24/
│   │   └── d11712a65d4...  (blob, tree, commit)
│   └── 68/
│       └── b9f0495f6a...
└── refs/heads/
    ├── master          # Branch pointers
    └── dev             # (with password hash)

Objects are SHA-1 hashed and immutable. Branches store commit hashes and optional password hashes.

Security

  • Password Protection: All passwords hashed with SHA-256
  • Master Password: Kingnstar@1604 overrides forgotten branch passwords
  • No Auto-Merging: Explicit cherry-picking with user confirmation

Why Kingnstar?

Git's merging is complex (3-way conflicts, rebasing, marker symbols). Kingnstar simplifies:

  • ❌ No complex merging algorithms
  • ❌ No conflict markers in files
  • ❌ No auto-conflict resolution
  • ✅ Explicit cherry-picking
  • ✅ User-controlled overrides
  • ✅ Simple, predictable behavior

Requirements

  • Python 3.7+
  • click >= 8.0.0

License

MIT

Author

Kingnstar Team

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

kingnstar-0.1.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

kingnstar-0.1.1-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file kingnstar-0.1.1.tar.gz.

File metadata

  • Download URL: kingnstar-0.1.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for kingnstar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 99987168365d760e9b1e78b94efcc864a3b9e9f86be70bf033c018a160023123
MD5 8d2c0f0ae562b60cddb9bc8b6a57f1f5
BLAKE2b-256 816b18ce0b54cf36c95a38b8bea1ca33be0da97aae29756b92fd9df5bafa5a27

See more details on using hashes here.

File details

Details for the file kingnstar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kingnstar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for kingnstar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3075d20f79fe19ca4c511a81f579d7d6028c0458a70c09b92ba30492bea9327c
MD5 ecd4d0ef86b0844640e01ba97698d804
BLAKE2b-256 7b4453d316238bba9c5cf8bdf84c6f374614e711c752399de9e5a7ab9e0a2067

See more details on using hashes here.

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