29 Commits

Author SHA1 Message Date
Yar Kravtsov
f96bfb6ce0 fix: prevent file loss when multiple files have same basename
Fixes #2: https://github.com/yarlson/lnk/issues/2

Previously, files with the same basename (e.g., a/config.json and b/config.json)
would overwrite each other in the repository, causing data loss. The second file
would completely replace the first, and removing files would fail with 'no such
file or directory' errors.

Changes:
- Store files using unique names based on full relative paths (slashes → underscores)
- Track full relative paths in .lnk file instead of just basenames
- Generate repository names from relative paths to prevent collisions
- Update symlink restoration to work with new path-based system
- Add comprehensive tests for basename collision scenarios

This ensures each file maintains its unique content and can be managed
independently, eliminating the data loss issue.
v0.0.4
2025-05-24 18:10:20 +03:00
Yar Kravtsov
7007ec64f2 refactor(test): update test commands to include all packages recursively 2025-05-24 11:39:20 +03:00
Yar Kravtsov
ec6ad6b0d0 refactor(test): update test commands to include all packages 2025-05-24 11:37:57 +03:00
Yar Kravtsov
e7f316ea6e ci: update test command to include all packages in CI and release workflows 2025-05-24 11:37:13 +03:00
Yar Kravtsov
09d67f181e refactor(tests): reorganize test files for improved structure and modularity 2025-05-24 11:35:40 +03:00
Yar Kravtsov
3a34e4fb37 refactor(cmd): centralize output formatting with printf helper function 2025-05-24 11:30:55 +03:00
Yar Kravtsov
fc0b567e9f refactor(cmd): improve testability and error handling in CLI commands 2025-05-24 11:28:16 +03:00
Yar Kravtsov
61a9cc8c88 feat: enhance CLI output with colorful and informative messages v0.0.3 2025-05-24 10:13:00 +03:00
Yar Kravtsov
1e2728fe33 feat(install): enhance installer script robustness and flexibility 2025-05-24 09:56:51 +03:00
Yar Kravtsov
13657a8142 feat(release): enhance Homebrew integration and security v0.0.2 2025-05-24 09:45:31 +03:00
Yar Kravtsov
3ebcae47d0 refactor(release): reorganize installation instructions for clarity v0.0.1 2025-05-24 09:40:01 +03:00
Yar Kravtsov
ffcff4a8c5 ci: upgrade GoReleaser action to v6 in CI and validate workflows 2025-05-24 09:35:09 +03:00
Yar Kravtsov
37a49827f6 ci: update GoReleaser action to v6 for improved release process 2025-05-24 09:33:26 +03:00
Yar Kravtsov
c1e4107ea9 feat: integrate Homebrew tap and enhance release process 2025-05-24 09:31:37 +03:00
Yar Kravtsov
398d011270 feat: implement CI/CD pipeline and release automation 2025-05-24 09:20:43 +03:00
Yar Kravtsov
905d88e0cf feat: simplify README and improve init command 2025-05-24 08:52:27 +03:00
Yar Kravtsov
d730007fb3 feat: add directory support and .lnk tracking
- Add directory management support alongside individual files

- Implement .lnk tracking file to manage files and directories

- Update filesystem validation to allow directories

- Add MoveDirectory method for handling directory operations

- Use git rm --cached to properly handle directory removal

- Add comprehensive tests for directory operations

- Update README with directory support documentation

- All 20 integration tests passing

Breaking: None (backward compatible)

Resolves: Git limitation of not tracking directories
2025-05-24 08:25:34 +03:00
Yar Kravtsov
88b3fbd238 feat: implement phase 1 sync functionality
- Add lnk status command to show repository sync status

- Add lnk push command for smart staging, committing, and pushing

- Add lnk pull command with automatic symlink restoration

- Add comprehensive sync functionality to git and core packages

- Add 5 new integration tests for sync commands (17 total tests)

- Update README with sync workflow examples and documentation

- Support commits ahead/behind tracking relative to remote

- Implement change detection to avoid empty commits

- Add graceful error handling for missing remotes

Closes: Phase 1 sync implementation
2025-05-24 07:20:49 +03:00
Yar Kravtsov
8ece50c5d7 docs: add MIT LICENSE file and proper linking - Add standard MIT license with copyright, update README to link to LICENSE file, complete repository licensing 2025-05-24 07:00:06 +03:00
Yar Kravtsov
4c3431b253 docs: showcase --remote flag in examples - Update Quick Start and examples to use 'lnk init -r' instead of manual git remote setup, better demonstrating built-in functionality 2025-05-24 06:56:37 +03:00
Yar Kravtsov
05922644a7 docs: strategic positioning based on competitive analysis - Position lnk as the missing middle between simple/unsafe and complex/overwhelming tools. Add comprehensive comparison with chezmoi, Mackup, Home Manager, Dotbot, and yadm. Emphasize safe simplicity, Git-native workflow, and zero-dependency advantages. 2025-05-24 06:54:12 +03:00
Yar Kravtsov
31ac8a4afa docs: rewrite README with developer-first UX/DX - Lead with value proposition, quick start, technical credibility, comparison table, FAQ, and realistic workflows for immediate adoption 2025-05-24 06:52:01 +03:00
Yar Kravtsov
2e4995eeb1 feat: implement comprehensive edge case handling for init command - Make lnk init idempotent and safe with repository protection, idempotent remote handling, comprehensive tests, and updated documentation 2025-05-24 06:49:06 +03:00
Yar Kravtsov
11cca86f4d feat: set 'main' as default branch instead of 'master' 2025-05-24 06:36:26 +03:00
Yar Kravtsov
d5812e1085 docs: add development status warning to README 2025-05-24 06:30:37 +03:00
Yar Kravtsov
be22511a8d fix: handle return values in error cleanup blocks (golangci-lint) 2025-05-24 06:28:26 +03:00
Yar Kravtsov
f640d6d11e feat: add --remote flag to init command for adding origin remote 2025-05-24 06:26:43 +03:00
Yar Kravtsov
9e1f834131 feat: add comprehensive Makefile with excellent DX 2025-05-24 06:22:13 +03:00
Yar Kravtsov
9088bbda50 feat: initial Lnk CLI implementation 2025-05-24 06:17:52 +03:00