| Age | Commit message (Collapse) | Author |
|
Split 562-line store.go into four files:
- store.go (264 lines): Store type, WalkIndexes, Search, action dispatch
- store_crud.go (160 lines): Add, Import, Remove, buildPair
- store_picker.go (160 lines): Fzf, PickerResult, key parsing
- store_shred.go (54 lines): ShredFile, ShredAllExported
No API or behaviour changes. All functions under 30 lines, all files under 300 lines.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
(tasks i4+l4)
Add optional WriteBack func([]byte) error field to Data struct.
ReimportAfterExport calls WriteBack(newContent) when set, otherwise
falls back to Commit. applyAction now calls s.LoadData (exported) so
the geheim and KeePass edit paths are symmetric. Tests cover nil,
non-nil, and error-propagation paths.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Default data_dir: ~/git/geheimlager → ~/git/foostore-data
- Default export_dir: ~/.geheimlagerexport → ~/.foostore-export
- Default key_file: ~/.geheimlager.key → ~/.foostore.key
- Rename env var GEHEIM_SHELL → FOOSTORE_SHELL
- Update package-level comments across cli, shell, store, git, config
- Update Magefile and CLAUDE.md docs to reflect new paths
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- internal/shell/shell_internal_test.go (new): tests prefixCompleter.Do
with table-driven cases covering empty prefix, partial match, no match,
and multi-word line (prefix after space)
- internal/cli/cli_test.go (new): tests pure helpers (logMsg, warn,
printHelp, shredFile), dispatch paths with real store (ls, search, cat,
rm, shred, get, paste, export, pathexport, open, edit, unknown command,
empty argv), error paths for cmdAdd/cmdImport/cmdImportR, readPIN env-var
path, completionFn commands-only path, makeActionFn nil cases
- internal/store/store_test.go: added TestSearchActionPathExport,
TestSearchActionWithCallback, TestSearchActionNilCallback, TestFzfEmpty,
TestRemoveInteractiveInvalidThenDecline, TestImportForceOverwrite
Total coverage: 44.8% → 63.3%
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- go.mod: module path codeberg.org/snonux/geheim → codeberg.org/snonux/foostore
- cmd/geheim/ → cmd/foostore/
- Magefile.go: binary/binaryName/mainPkg constants updated
- internal/config: config file path ~/.config/geheim.json → ~/.config/foostore.json
- All import paths and comments updated throughout
- Delete geheim.rb (the original Ruby implementation, superseded by this Go rewrite)
- CLAUDE.md rewritten to reflect the Go implementation, new binary name,
build system (mage), and current package architecture
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Fix CommitIndex to respect force=false by checking os.Stat before writing,
mirroring the Data.Commit behaviour and keeping index/data pairs consistent.
Skip .git directory in WalkIndexes via filepath.SkipDir to avoid spurious
errors or false matches inside the git metadata tree.
Make ShredAllExported continue past individual shred errors and return the
last error, matching Ruby's best-effort shredding behaviour.
Accept io.Reader in Store.Remove instead of hardwiring os.Stdin, enabling
deterministic testing via strings.NewReader injection.
Fix runFzf comment to state that any non-zero fzf exit is treated as no
selection (not only exit 130).
Document ImportRecursive divergence from Ruby basename-flattening behaviour.
Add 14 new tests: Search, SearchActionCat, SearchActionCatBinarySkip,
ShredAllExported, SearchActionExport, ImportRecursive, ReimportAfterExport,
RemoveInteractive, RemoveInteractiveDecline, CommitIndexSkipsExisting,
LoadIndexMissingFile, LoadIndexCorrupted, LoadDataMissingFile,
LoadDataCorrupted, DataExportUnwritable, HashPathEdgeCases,
ImportMissingSourceFile, WalkIndexesInvalidRegex.
Improve TestIndexSort to call sort.Sort and assert final order.
Remove orphaned section-header comment from store_test.go.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
Adds internal/store with Index, Data, and Store types that mirror the Ruby
Index, GeheimData, and Geheim classes. All 22 tests pass including
AddAndSearch, Import, Export, Remove, HashPath, IsBinary, and sort interface.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
- go.mod with module codeberg.org/snonux/geheim (go 1.22, mage dep)
- Magefile.go with Build, Test, Install, Uninstall targets
- cmd/geheim/main.go delegating to internal/cli
- Stub packages: cli, version, config, crypto, git, store, clipboard, shell
- go.sum generated; binary confirmed to build via mage build
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|