diff --git a/CHANGELOG.md b/CHANGELOG.md index 14fcfa0..58b57a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Backup refs under `refs/git-time-machine/backups/` before hard resets. - Confirmation dialog now shows the exact Git command before restore. - Project roadmap with near-term recovery work, distribution plans, and explicit non-goals. +- `--list-backups` command for finding backup refs and exact recovery commands. ### Changed - Tightened README, CLI, crate, and landing-page language around what reflog-based recovery can and cannot do. diff --git a/README.md b/README.md index 7a4fc65..2bac7a9 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,9 @@ git-time-machine --all # Export the current reflog view as JSON git-time-machine --export-json + +# List hard-reset backup refs and recovery commands +git-time-machine --list-backups ``` ### Controls @@ -83,6 +86,7 @@ git-time-machine --export-json - ✅ **Relative Timestamps** - "5m ago", "2h ago", "yesterday" - ✅ **Diff Preview** - Compare the selected entry before restoring - ✅ **Safer Restore Modes** - Choose hard reset, soft reset, or detached checkout +- ✅ **Backup Ref Recovery** - List backup refs and exact recovery commands - ✅ **Search/Filter** - Filter commit messages with multi-word search - ✅ **JSON Export** - Export the reflog timeline for automation - ✅ **Vim Keybindings** - j/k and gg/G navigation @@ -195,6 +199,15 @@ git-time-machine **It's just Git under the hood** - useful, but not magic. Hard reset is destructive, so git-time-machine creates a backup ref under `refs/git-time-machine/backups/` before running it. +To find those backup refs later: + +```bash +git-time-machine --list-backups +``` + +The command prints each backup ref, the commit it points to, and exact `git show` +and `git reset --hard` commands for manual inspection and recovery. + ## 🤔 Why Not Just Use Git Commands? **You absolutely can!** But here's the reality: diff --git a/ROADMAP.md b/ROADMAP.md index d42adf2..3ff98c2 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -27,6 +27,7 @@ Recent work established the foundation for safer iteration: - CI runs `cargo fmt --check`, `cargo clippy -- -D warnings`, and tests. - Restore now supports hard reset, soft reset, and detached checkout modes. - Hard reset creates a backup ref under `refs/git-time-machine/backups/`. +- Backup refs can be listed with exact inspect and restore commands. - The confirmation dialog shows the exact Git command before a restore. - Full diff preview now compares `HEAD` to the selected target, matching restore semantics. @@ -35,16 +36,14 @@ Recent work established the foundation for safer iteration: These are the next practical improvements, ordered by risk and user value. -### Backup ref UX +### Backup ref management -Hard reset now creates backup refs, but users still need to know how to inspect -and use them. Add a small workflow to list, inspect, restore from, and eventually -prune refs under `refs/git-time-machine/backups/`. +Hard reset backup refs can now be listed with recovery commands. Future work can +make them easier to restore from or prune inside the TUI. Acceptance criteria: -- A user can find the last backup ref without memorizing the ref path. -- The UI or docs show the exact Git command needed to recover from a backup ref. -- Tests cover backup-ref naming and lookup behavior. +- A user can restore from a selected backup ref without copying the ref path. +- Backup prune behavior is explicit, confirmed, and test-covered. ### Copy selected commit hash diff --git a/docs/index.html b/docs/index.html index 1080690..a69a41f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -103,7 +103,8 @@
git-time-machineVisual and deliberate
@@ -131,6 +132,11 @@Inspect the selected state before restoring
+List hard-reset backup refs and exact recovery commands
+# Launch in any git repository
git-time-machine
# Show up to 1000 reflog entries (default: last 50)
git-time-machine --all
# Export reflog entries as JSON
git-time-machine --export-json
+ # Launch in any git repository
git-time-machine
# Show up to 1000 reflog entries (default: last 50)
git-time-machine --all
# Export reflog entries as JSON
git-time-machine --export-json
# List hard-reset backup refs and recovery commands
git-time-machine --list-backups
Confirmation dialogs show the exact Git command, hard resets create backup refs first, and safer soft-reset or detached-checkout modes are available.
+Confirmation dialogs show the exact Git command, hard resets create backup refs first, and --list-backups shows recovery commands later.
Did git reset --hard and need to go back? Time machine shows recent local reflog states, previews the target, and creates a backup ref before another hard reset.
+Did git reset --hard and need to go back? Time machine shows recent local reflog states, previews the target, creates a backup ref before another hard reset, and can list those backup refs later.