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.0.tar.gz (11.3 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.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kingnstar-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 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.0.tar.gz
Algorithm Hash digest
SHA256 12de7fab284bbafa0306b4049853483175eeeb4a2d70af70abd8fc4d86790603
MD5 a51822ca08ee1cbfdce9000e6633d0cc
BLAKE2b-256 c5491aa22a51672cbc028c418f51619968ec48bc2e59a14a441637fb4ebddfff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kingnstar-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a891235bfac20a980a66e2ba2029a6355f564233526ca771336af0d8a7458631
MD5 ed25df6a515327e893b8a94fdf2351f7
BLAKE2b-256 acda2b46738d1dd0605305c08df926c1e42cb31bddd9a1f6463986defeb1054a

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