Releases: h13/autoreload.fish
Releases · h13/autoreload.fish
v1.19.0
Refactoring
- Remove
do_cleanupflag in__autoreload_source_file: Eliminated intermediate boolean variable, calling__autoreload_cleanup_enableddirectly at each branch point. Reduces cognitive load and removes YAGNI indirection (-4 lines).
Stats
- 137 tests passing
- 22 production files, ~400 LOC
v1.18.0
Consistency & uninstall completeness
Improvements
set -q autoreload_exclude[1]idiom —show_statusandis_excludednow use the R7 element-existence check instead of bareset -q, correctly handling the edge case whereautoreload_excludeis set to an empty list.- Completions erased on uninstall —
__autoreload_cleanup_allnow callscomplete -e -c autoreloadso tab completions are removed in the current session, not just functions and variables.
Tests
- Added test for empty exclude list display (137 total assertions).
- Added test verifying completions are erased after uninstall.
v1.17.0
Fix: autoreload enable scope safety
Bug Fix
autoreload enablenow clears both global and universal scopes — Previously, if a user hadset -U autoreload_enabled 0(persistent disable), runningautoreload enablewould only erase the global scope, leaving the universal value to shadow the enabled state. The command now uses explicitset -eg+set -eU, matching the pattern already established in__autoreload_cleanup_all.
Tests
- Added 2 tests verifying
enableclears universal scope and fully restores enabled state (135 total assertions).
v1.16.0
Test harness consistency and robustness
Production code unchanged — comprehensive review of all 22 function files found no remaining improvements. This release improves test harness quality:
- Use
__autoreload_basenameinstead of inline regex in cleanup loop (Test 40) - Source all function files including
autoreloadCLI on re-init after uninstall (Test 47) - Use
set -qidiom for emptiness check, matching v1.15.0 pattern (Test 47) - 133 assertions across 48 test groups, all passing on Fish 3.x/4.x + macOS/Linux
v1.15.0
Refactor: Consistency fix in show_status
Replace test (count ...) -gt 0 with set -q ...[1] for the __autoreload_tracked_keys emptiness check in autoreload status, matching the idiomatic pattern applied to $flags in v1.13.0.
Summary
- Zero behavioral change
- 133 assertions across 48 test groups
v1.14.0
Fix: Message prefix duplication (fish cartesian product)
When multiple files changed simultaneously, user-facing messages like autoreload: sourced a.fish b.fish would incorrectly repeat the full prefix for each filename due to fish's cartesian product expansion of list variables inside double quotes.
Before (buggy)
autoreload: sourced a.fish autoreload: sourced b.fish
After (fixed)
autoreload: sourced a.fish b.fish
Changes
- Fix sourced/failed/removed messages to avoid cartesian product expansion
- Fix
autoreload statusexcluding display with multiple excludes - Add tests verifying single-prefix output for multi-file operations
- 133 assertions across 48 test groups
v1.13.0
Changes
- Fix:
autoreload_excludenow takes effect immediately for tracked files — Previously, excluding an already-monitored file requiredautoreload resetfor the exclusion to take effect. Now the exclude list is checked at change-detection time, soset -g autoreload_exclude foo.fishstops re-sourcingfoo.fishon the very next prompt. The check only runs for files whose mtime has actually changed, so there is zero overhead on normal "no change" prompts. - Consistency:
show_statusemptiness check — Replacedtest (count $flags) -gt 0withset -q flags[1]to match the codebase convention. - New test (Test 43) — Verifies that runtime exclusion of an already-tracked file prevents re-sourcing on change.
Stats
- 129 tests passing across 48 test groups
v1.12.0
Changes
- Fix remaining pipe in cleanup_all — convert
set --global --names | string matchto command substitution, eliminating the last unnecessary pipe subprocess in production code - Fix outdated README — "Source failure behavior" section now correctly reflects v1.11.0 behavior: side effects from partial/failed sources are tracked for cleanup
- Clean test pipes — replace 4 instances of
abbr --list | string matchwith command substitution in test assertions for consistency
Stats
- 126 tests passing across 47 test groups
- All production code is now pipe-free
v1.11.0
Changes
Bug Fix
- Always track cleanup side effects regardless of source exit status: Fish's
sourcereturns the exit status of the last command in the file, not whether sourcing itself succeeded. Previously,record_diffwas skipped on non-zero exit, leaving side effects permanently untracked by the cleanup system. Files with patterns liketest -d /opt/homebrew && fish_add_path ...(where the last command can return non-zero) now have their side effects correctly tracked and cleaned up.
Performance
- Merge two stat forks into one in
__autoreload_snapshot: Same optimization applied to__autoreload_run_checkin v1.10.0 — combines file mtime andconf.ddirectory mtime into a single batchstatcall.
Code Quality
- Hoist invariant
containscheck out of inner loop in__autoreload_record_diff. - Replace pipe with command substitution in
__autoreload_cleanup_allto avoid unnecessary subprocess. - Replace
command basenamewithstring replacein tests for consistency.
Tests
- Add test verifying cleanup tracking works when file's last command returns non-zero (the fixed bug).
- 126 tests passing.
v1.10.0
Changes
Refactoring
- Eliminate global return values:
__autoreload_conf_filesnow returns file list via stdout instead of the__autoreload_discovered_filesglobal variable. Callers capture output in local variables. - Extract
__autoreload_is_disabledpredicate: Consistent withis_debug,is_quiet,cleanup_enabledpattern. - Replace pipe with command substitution in
__autoreload_keyto avoid unnecessary subprocess.
Performance
- Merge two stat forks into one:
__autoreload_run_checknow gets mtimes for tracked files and theconf.ddirectory in a single batchstatcall, reducing fork count per prompt.
Bug Fix
- Race condition fallback: When a file vanishes between
test -fandstat(causing count mismatch), the check now falls back to per-file stat instead of silently skipping changes.
Tests
- Add test for
config.fishmodification detection (not just creation). - Add test for batch stat fallback path using mocked
__autoreload_mtime. - 123 tests passing.
Documentation
- Document
fish_user_pathscross-shell side effect in README limitations.