feat(init): initial commit
This commit is contained in:
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal 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
113
CHECKLIST.md
Normal 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
|
||||||
21
README.md
Normal file
21
README.md
Normal 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
25
build.gradle.kts
Normal 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
2
gradle.properties
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
org.gradle.caching=true
|
||||||
|
org.gradle.configuration-cache=true
|
||||||
2
settings.gradle
Normal file
2
settings.gradle
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
rootProject.name = "NoteVC"
|
||||||
|
include("src")
|
||||||
5
src/main/kotlin/io/notevc/NoteVC.kt
Normal file
5
src/main/kotlin/io/notevc/NoteVC.kt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package io.notevc
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
println("hello world")
|
||||||
|
}
|
||||||
1
src/main/kotlin/io/notevc/cli/CommandParser.kt
Normal file
1
src/main/kotlin/io/notevc/cli/CommandParser.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.cli
|
||||||
1
src/main/kotlin/io/notevc/cli/OutputFormatter.kt
Normal file
1
src/main/kotlin/io/notevc/cli/OutputFormatter.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.cli
|
||||||
1
src/main/kotlin/io/notevc/commands/CommitCommand.kt
Normal file
1
src/main/kotlin/io/notevc/commands/CommitCommand.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.commands
|
||||||
1
src/main/kotlin/io/notevc/commands/DiffCommand.kt
Normal file
1
src/main/kotlin/io/notevc/commands/DiffCommand.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.commands
|
||||||
1
src/main/kotlin/io/notevc/commands/InitCommand.kt
Normal file
1
src/main/kotlin/io/notevc/commands/InitCommand.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.commands
|
||||||
1
src/main/kotlin/io/notevc/commands/LogCommand.kt
Normal file
1
src/main/kotlin/io/notevc/commands/LogCommand.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.commands
|
||||||
1
src/main/kotlin/io/notevc/commands/RestoreCommand.kt
Normal file
1
src/main/kotlin/io/notevc/commands/RestoreCommand.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.commands
|
||||||
1
src/main/kotlin/io/notevc/commands/StatusCommand.kt
Normal file
1
src/main/kotlin/io/notevc/commands/StatusCommand.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.commands
|
||||||
1
src/main/kotlin/io/notevc/core/NoteSnapshot.kt
Normal file
1
src/main/kotlin/io/notevc/core/NoteSnapshot.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.core
|
||||||
1
src/main/kotlin/io/notevc/core/ObjectStore.kt
Normal file
1
src/main/kotlin/io/notevc/core/ObjectStore.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.core
|
||||||
1
src/main/kotlin/io/notevc/core/Repository.kt
Normal file
1
src/main/kotlin/io/notevc/core/Repository.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.core
|
||||||
1
src/main/kotlin/io/notevc/core/Timeline.kt
Normal file
1
src/main/kotlin/io/notevc/core/Timeline.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.core
|
||||||
1
src/main/kotlin/io/notevc/storage/FileStorage.kt
Normal file
1
src/main/kotlin/io/notevc/storage/FileStorage.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.storage
|
||||||
1
src/main/kotlin/io/notevc/storage/MetadataStorage.kt
Normal file
1
src/main/kotlin/io/notevc/storage/MetadataStorage.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.storage
|
||||||
1
src/main/kotlin/io/notevc/utils/FileUtils.kt
Normal file
1
src/main/kotlin/io/notevc/utils/FileUtils.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.utils
|
||||||
1
src/main/kotlin/io/notevc/utils/HashUtils.kt
Normal file
1
src/main/kotlin/io/notevc/utils/HashUtils.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.utils
|
||||||
1
src/main/kotlin/io/notevc/utils/TimeUtils.kt
Normal file
1
src/main/kotlin/io/notevc/utils/TimeUtils.kt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
package io.notevc.utils
|
||||||
Reference in New Issue
Block a user