feat(init): initial commit

This commit is contained in:
darwincereska
2025-11-05 21:15:30 -05:00
commit e6a5ed03c1
25 changed files with 215 additions and 0 deletions

30
.gitignore vendored Normal file
View File

@@ -0,0 +1,30 @@
# Gradle Files
.gradle/
build/
out/
**/build/
**/out/
gradle-app.setting
# Local configuration files
local.properties
*.iml
# IDE files
.idea/
*.ipr
*.iws
*.class
*.jar
*.war
*.ear
# OS-Generated files
.DS_Store
Thumbs.db
# Log files
*.log
# Other
*.hprof

113
CHECKLIST.md Normal file
View File

@@ -0,0 +1,113 @@
# Project Setup
- [x] Initialize Project
- [x] Configure `build.gradle.kts` with dependencies
- [ ] Set up testing framework
# Core
- [ ] Create `Repository.kt` class
- [ ] Implement `.notevc` directory initialization
- [ ] Create `ObjectStore.kt` for content storage
- [ ] Implement content hashing `HashUtils.kt`
- [ ] Create `NoteSnapshot` data class
- [ ] Implement `Timeline.kt` for version tracking
- [ ] Add `RepoMetadata` and configuration
# File Operations
- [ ] Implement markdown file scanning
- [ ] Create file change detection logic
- [ ] Add file content reading/writing utilities
- [ ] Implement path resolution and validation
- [ ] Add file timestamp tracking
- [ ] Create backup and restore mechanisms
# Core Commands
## Init Command
- [ ] `notevc init` - Initialize repository
- [ ] Create `.notevc` directory structure
- [ ] Generate initial metadata file
- [ ] Handle existing repository detection
## Status Command
- [ ] `notevc status` - Show file changes
- [ ] Compare current files with last snapshot
- [ ] Display added/modified/deleted files
- [ ] Show clean working directory message
## Commit command
- [ ] `notevc commit "message"` - Create snapshot
- [ ] Validate commit message exists
- [ ] Store changed file contents
- [ ] Create snapshot with metadata
- [ ] Update repository head pointer
## Log Command
- [ ] `notevc log` - Show commit history
- [ ] Display snapshots in reverse chronological order
- [ ] Show commit hashes, messages, and timestamps
- [ ] add `--since` time filtering option
# Advanced Commands
## Diff Command
- [ ] `notevc diff` - Show current changes
- [ ] `notevc diff <file>` - Show changes for specific file
- [ ] `notevc diff <commit>` - Compare with specific commit
- [ ] Implement basic text diffing algorithm
## Restore Command
- [ ] `notevc restore <commit>` - Restore entire state
- [ ] `notevc restore <commit> <file>` - Restore specific file
- [ ] Add conformation prompts for destructive operations
- [ ] Handle file conflicts gracefully
## Show Command
- [ ] `notevc show <commit>` - Display commit changes
- [ ] Show commit metadata and file changes
- [ ] Display file contents at specific commit
# Utilities and Polish
- [ ] Add colored output for better UX
- [ ] Implement proper error handling messages
- [ ] Add input validation for all commands
- [ ] Create help system (`notevc --help`)
- [ ] Add version information (`notevc --version`)
- [ ] Implement configuration file support
# Testing
- [ ] Write unit tests for `ObjectStore`
- [ ] Test `Repository` initialization and operations
- [ ] Add integration tests for CLI commands
- [ ] Test file change detection logic
- [ ] Add edge case testing (empty repos, corrupted data)
- [ ] Performance testing with large note collections
# Build and Distribution
- [ ] Create fat JAR for distribution
- [ ] Add shell script wrapper for easy execution
- [ ] Test on different operating systems
- [ ] Create installation scripts
- [ ] Add build automation (GitHub Actions)
# Future Features
- [ ] Compression for stored content
- [ ] Garbage collection for unused objects
- [ ] Branch-like functionality for different contexts
- [ ] Automatic backup scheduling
- [ ] File watching for auto-commits
- [ ] Export/import functionality
- [ ] NeoVim Plugin

0
LICENSE Normal file
View File

21
README.md Normal file
View File

@@ -0,0 +1,21 @@
# NoteVC: Version Control for Markdown
# Repository management
notevc init [path] # Initialize notevc repo
notevc status # Show changed files
notevc commit "message" # Create snapshot
notevc log [--since=time] # Show commit history
# Viewing changes
notevc diff [file] # Show changes since last commit
notevc diff HEAD~1 [file] # Compare with previous commit
notevc show <commit-hash> # Show specific commit
# Restoration
notevc restore <commit-hash> [file] # Restore to specific version
notevc checkout <commit-hash> # Restore entire repo state
# Utilities
notevc clean # Remove old snapshots
notevc gc # Garbage collect unused objects
notevc config # Show/set configuration

25
build.gradle.kts Normal file
View File

@@ -0,0 +1,25 @@
plugins {
kotlin("jvm") version "2.2.21"
application
}
group = "io.notevc"
version = "1.0.0"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
}
application {
mainClass.set("io.notevc.NoteVCKt")
}
tasks.jar {
manifest {
attributes["Main-Class"] = "io.notevc.NoteVCKt"
}
}

2
gradle.properties Normal file
View File

@@ -0,0 +1,2 @@
org.gradle.caching=true
org.gradle.configuration-cache=true

2
settings.gradle Normal file
View File

@@ -0,0 +1,2 @@
rootProject.name = "NoteVC"
include("src")

View File

@@ -0,0 +1,5 @@
package io.notevc
fun main() {
println("hello world")
}

View File

@@ -0,0 +1 @@
package io.notevc.cli

View File

@@ -0,0 +1 @@
package io.notevc.cli

View File

@@ -0,0 +1 @@
package io.notevc.commands

View File

@@ -0,0 +1 @@
package io.notevc.commands

View File

@@ -0,0 +1 @@
package io.notevc.commands

View File

@@ -0,0 +1 @@
package io.notevc.commands

View File

@@ -0,0 +1 @@
package io.notevc.commands

View File

@@ -0,0 +1 @@
package io.notevc.commands

View File

@@ -0,0 +1 @@
package io.notevc.core

View File

@@ -0,0 +1 @@
package io.notevc.core

View File

@@ -0,0 +1 @@
package io.notevc.core

View File

@@ -0,0 +1 @@
package io.notevc.core

View File

@@ -0,0 +1 @@
package io.notevc.storage

View File

@@ -0,0 +1 @@
package io.notevc.storage

View File

@@ -0,0 +1 @@
package io.notevc.utils

View File

@@ -0,0 +1 @@
package io.notevc.utils

View File

@@ -0,0 +1 @@
package io.notevc.utils