From 390072e91985e523d6f3eff5280b9d2cdaecc894 Mon Sep 17 00:00:00 2001 From: rootiest Date: Tue, 23 Jun 2026 23:07:46 -0400 Subject: [PATCH] fix(auto-pull): respect $__fish_user_dots_path for registry location Both the auto-pull function and the PWD event handler hardcoded $XDG_CONFIG_HOME/.user-dots/fish as the registry directory. They now resolve $__fish_user_dots_path first, falling back to the same default, so a custom path set via config-settings is honoured. --- conf.d/auto-pull.fish | 4 ++-- docs/fish-config.md | 7 ++++--- functions/auto-pull.fish | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/conf.d/auto-pull.fish b/conf.d/auto-pull.fish index 4096ed2..41fa0a7 100644 --- a/conf.d/auto-pull.fish +++ b/conf.d/auto-pull.fish @@ -26,8 +26,8 @@ __fish_config_op_enabled __fish_config_op_autoexec; or exit # repository entry rather than on every sub-directory change. function __auto_pull_on_pwd --on-variable PWD set -q __fish_config_dir; or set -g __fish_config_dir $XDG_CONFIG_HOME/fish - - set -l list "$XDG_CONFIG_HOME/.user-dots/fish/auto-pull.list" + set -q __fish_user_dots_path; or set -l __fish_user_dots_path "$XDG_CONFIG_HOME/.user-dots/fish" + set -l list "$__fish_user_dots_path/auto-pull.list" # Candidate roots: the fish-config repo plus the user's registry. set -l roots $__fish_config_dir diff --git a/docs/fish-config.md b/docs/fish-config.md index d23ac9f..c564532 100644 --- a/docs/fish-config.md +++ b/docs/fish-config.md @@ -772,8 +772,9 @@ Add -i (interactive confirmation) to destructive commands: Manages the registry of repositories that are background fast-forwarded when you enter them (see "Auto-pull fast-forward" under the C2 component reference). The fish-config repo is always covered as a baseline. The - registry is machine-local at ~/.config/.user-dots/fish/auto-pull.list, one - absolute path per line, and is never committed. Registry management works + registry is machine-local at `$__fish_user_dots_path/auto-pull.list` (defaults + to `~/.config/.user-dots/fish/auto-pull.list`), one absolute path per line, + and is never committed. Registry management works even when C2 auto-execution is disabled; only the background sync is gated. list Show registered repos (default) @@ -1762,7 +1763,7 @@ ever fast-forwards a clean repo whose branch has an upstream — never rebases, merges, or overwrites work — so it is a no-op on dirty trees, divergent branches, or repos without a remote. The handler fires once per repo entry (not on every sub-directory cd). The registry is machine-local at -~/.config/.user-dots/fish/auto-pull.list and is never committed. +`$__fish_user_dots_path/auto-pull.list` (defaults to `~/.config/.user-dots/fish/auto-pull.list`) and is never committed. #### C3 — Key and Environment Overrides diff --git a/functions/auto-pull.fish b/functions/auto-pull.fish index 0378503..2dd58b7 100644 --- a/functions/auto-pull.fish +++ b/functions/auto-pull.fish @@ -45,7 +45,8 @@ function auto-pull --description 'Manage the auto-pull repository registry' set -l c_reset (set_color normal) set -q __fish_config_dir; or set -l __fish_config_dir $XDG_CONFIG_HOME/fish - set -l list "$XDG_CONFIG_HOME/.user-dots/fish/auto-pull.list" + set -q __fish_user_dots_path; or set -l __fish_user_dots_path "$XDG_CONFIG_HOME/.user-dots/fish" + set -l list "$__fish_user_dots_path/auto-pull.list" set -l cmd $argv[1] set -e argv[1] -- 2.52.0