Skip to content

Releases: h13/autoreload.fish

v1.19.0

01 Mar 23:11
@h13 h13

Choose a tag to compare

Refactoring

  • Remove do_cleanup flag in __autoreload_source_file: Eliminated intermediate boolean variable, calling __autoreload_cleanup_enabled directly 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

01 Mar 21:55
@h13 h13

Choose a tag to compare

Consistency & uninstall completeness

Improvements

  • set -q autoreload_exclude[1] idiomshow_status and is_excluded now use the R7 element-existence check instead of bare set -q, correctly handling the edge case where autoreload_exclude is set to an empty list.
  • Completions erased on uninstall__autoreload_cleanup_all now calls complete -e -c autoreload so 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

01 Mar 13:57
@h13 h13

Choose a tag to compare

Fix: autoreload enable scope safety

Bug Fix

  • autoreload enable now clears both global and universal scopes — Previously, if a user had set -U autoreload_enabled 0 (persistent disable), running autoreload enable would only erase the global scope, leaving the universal value to shadow the enabled state. The command now uses explicit set -eg + set -eU, matching the pattern already established in __autoreload_cleanup_all.

Tests

  • Added 2 tests verifying enable clears universal scope and fully restores enabled state (135 total assertions).

v1.16.0

01 Mar 13:24
@h13 h13

Choose a tag to compare

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_basename instead of inline regex in cleanup loop (Test 40)
  • Source all function files including autoreload CLI on re-init after uninstall (Test 47)
  • Use set -q idiom 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

01 Mar 13:00
@h13 h13

Choose a tag to compare

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

01 Mar 12:56
@h13 h13

Choose a tag to compare

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 status excluding display with multiple excludes
  • Add tests verifying single-prefix output for multi-file operations
  • 133 assertions across 48 test groups

v1.13.0

01 Mar 12:30
@h13 h13

Choose a tag to compare

Changes

  • Fix: autoreload_exclude now takes effect immediately for tracked files — Previously, excluding an already-monitored file required autoreload reset for the exclusion to take effect. Now the exclude list is checked at change-detection time, so set -g autoreload_exclude foo.fish stops re-sourcing foo.fish on 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_status emptiness check — Replaced test (count $flags) -gt 0 with set -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

01 Mar 12:23
@h13 h13

Choose a tag to compare

Changes

  • Fix remaining pipe in cleanup_all — convert set --global --names | string match to 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 match with 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

01 Mar 12:06
@h13 h13

Choose a tag to compare

Changes

Bug Fix

  • Always track cleanup side effects regardless of source exit status: Fish's source returns the exit status of the last command in the file, not whether sourcing itself succeeded. Previously, record_diff was skipped on non-zero exit, leaving side effects permanently untracked by the cleanup system. Files with patterns like test -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_check in v1.10.0 — combines file mtime and conf.d directory mtime into a single batch stat call.

Code Quality

  • Hoist invariant contains check out of inner loop in __autoreload_record_diff.
  • Replace pipe with command substitution in __autoreload_cleanup_all to avoid unnecessary subprocess.
  • Replace command basename with string replace in 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

01 Mar 10:11
@h13 h13

Choose a tag to compare

Changes

Refactoring

  • Eliminate global return values: __autoreload_conf_files now returns file list via stdout instead of the __autoreload_discovered_files global variable. Callers capture output in local variables.
  • Extract __autoreload_is_disabled predicate: Consistent with is_debug, is_quiet, cleanup_enabled pattern.
  • Replace pipe with command substitution in __autoreload_key to avoid unnecessary subprocess.

Performance

  • Merge two stat forks into one: __autoreload_run_check now gets mtimes for tracked files and the conf.d directory in a single batch stat call, reducing fork count per prompt.

Bug Fix

  • Race condition fallback: When a file vanishes between test -f and stat (causing count mismatch), the check now falls back to per-file stat instead of silently skipping changes.

Tests

  • Add test for config.fish modification detection (not just creation).
  • Add test for batch stat fallback path using mocked __autoreload_mtime.
  • 123 tests passing.

Documentation

  • Document fish_user_paths cross-shell side effect in README limitations.