style: format fish files with fish_indent

This commit is contained in:
2026-09-09 20:27:48 -04:00
parent 2dc978e719
commit e40d67df59
58 changed files with 1184 additions and 1015 deletions
+4 -5
View File
@@ -3,7 +3,7 @@
function __bd_debug function __bd_debug
set -l file "$BASH_COMP_DEBUG_FILE" set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file" if test -n "$file"
echo "$argv" >> $file echo "$argv" >>$file
end end
end end
@@ -108,7 +108,6 @@ function __bd_requires_order_preservation
return 1 return 1
end end
# This function does two things: # This function does two things:
# - Obtain the completions and store them in the global __bd_comp_results # - Obtain the completions and store them in the global __bd_comp_results
# - Return false if file completion should be performed # - Return false if file completion should be performed
@@ -215,18 +214,18 @@ end
# so we can properly delete any completions provided by another script. # so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides, # Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found. # the existing completions will only be loaded if the program can be found.
if type -q "bd" if type -q bd
# The space after the program name is essential to trigger completion for the program # The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself. # and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "bd " > /dev/null 2>&1 complete --do-complete "bd " >/dev/null 2>&1
end end
# Remove any pre-existing completions for the program since we will be handling all of them. # Remove any pre-existing completions for the program since we will be handling all of them.
complete -c bd -e complete -c bd -e
# this will get called after the two calls below and clear the $__bd_perform_completion_once_result global # this will get called after the two calls below and clear the $__bd_perform_completion_once_result global
complete -c bd -n '__bd_clear_perform_completion_once_result' complete -c bd -n __bd_clear_perform_completion_once_result
# The call to __bd_prepare_completions will setup __bd_comp_results # The call to __bd_prepare_completions will setup __bd_comp_results
# which provides the program's completion choices. # which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag # If this doesn't require order preservation, we don't use the -k flag
+22 -22
View File
@@ -1,14 +1,14 @@
# fish completion for copilot # fish completion for copilot
# Generated by `copilot completion fish`. Do not edit by hand. # Generated by `copilot completion fish`. Do not edit by hand.
complete -c copilot -n '__fish_use_subcommand' -f -a 'login' -d 'Authenticate with Copilot' complete -c copilot -n __fish_use_subcommand -f -a login -d 'Authenticate with Copilot'
complete -c copilot -n '__fish_use_subcommand' -f -a 'help' -d 'Display help information' complete -c copilot -n __fish_use_subcommand -f -a help -d 'Display help information'
complete -c copilot -n '__fish_use_subcommand' -f -a 'init' -d 'Initialize Copilot instructions' complete -c copilot -n __fish_use_subcommand -f -a init -d 'Initialize Copilot instructions'
complete -c copilot -n '__fish_use_subcommand' -f -a 'update' -d 'Download the latest version' complete -c copilot -n __fish_use_subcommand -f -a update -d 'Download the latest version'
complete -c copilot -n '__fish_use_subcommand' -f -a 'version' -d 'Display version information' complete -c copilot -n __fish_use_subcommand -f -a version -d 'Display version information'
complete -c copilot -n '__fish_use_subcommand' -f -a 'plugin' -d 'Manage plugins' complete -c copilot -n __fish_use_subcommand -f -a plugin -d 'Manage plugins'
complete -c copilot -n '__fish_use_subcommand' -f -a 'mcp' -d 'Manage MCP servers' complete -c copilot -n __fish_use_subcommand -f -a mcp -d 'Manage MCP servers'
complete -c copilot -n '__fish_use_subcommand' -f -a 'completion' -d 'Generate a shell completion script' complete -c copilot -n __fish_use_subcommand -f -a completion -d 'Generate a shell completion script'
complete -c copilot -l version -s v -f -d 'show version information' complete -c copilot -l version -s v -f -d 'show version information'
complete -c copilot -l interactive -s i -r -d 'Start interactive mode and automatically execute this prompt' complete -c copilot -l interactive -s i -r -d 'Start interactive mode and automatically execute this prompt'
complete -c copilot -l prompt -s p -r -d 'Execute a prompt in non-interactive mode (exits after completion)' complete -c copilot -l prompt -s p -r -d 'Execute a prompt in non-interactive mode (exits after completion)'
@@ -75,22 +75,22 @@ complete -c copilot -l acp -f -d 'Start as Agent Client Protocol server'
complete -c copilot -l remote -f -d 'Enable remote control of your session from GitHub web and mobile' complete -c copilot -l remote -f -d 'Enable remote control of your session from GitHub web and mobile'
complete -c copilot -l no-remote -f -d 'Disable remote control of your session from GitHub web and mobile' complete -c copilot -l no-remote -f -d 'Disable remote control of your session from GitHub web and mobile'
complete -c copilot -n '__fish_seen_subcommand_from login' -l host -r -d 'GitHub host URL (default: https://github.com)' complete -c copilot -n '__fish_seen_subcommand_from login' -l host -r -d 'GitHub host URL (default: https://github.com)'
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'install' -d 'Install a plugin' complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a install -d 'Install a plugin'
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'uninstall' -d 'Uninstall a plugin' complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a uninstall -d 'Uninstall a plugin'
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'update' -d 'Update a plugin' complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a update -d 'Update a plugin'
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'list' -d 'List installed plugins' complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a list -d 'List installed plugins'
complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a 'marketplace' -d 'Manage plugin marketplaces' complete -c copilot -n '__fish_seen_subcommand_from plugin' -f -a marketplace -d 'Manage plugin marketplaces'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from update' -l all -f -d 'Update all installed plugins' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from update' -l all -f -d 'Update all installed plugins'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'add' -d 'Add a marketplace' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a add -d 'Add a marketplace'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'remove' -d 'Remove a marketplace' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a remove -d 'Remove a marketplace'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'list' -d 'List registered marketplaces' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a list -d 'List registered marketplaces'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'browse' -d 'Browse plugins in a marketplace' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a browse -d 'Browse plugins in a marketplace'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a 'update' -d 'Update marketplace plugin catalogs' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace' -f -a update -d 'Update marketplace plugin catalogs'
complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace; and __fish_seen_subcommand_from remove' -l force -s f -f -d 'Force removal even if plugins are installed' complete -c copilot -n '__fish_seen_subcommand_from plugin; and __fish_seen_subcommand_from marketplace; and __fish_seen_subcommand_from remove' -l force -s f -f -d 'Force removal even if plugins are installed'
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'list' -d 'List configured MCP servers' complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a list -d 'List configured MCP servers'
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'get' -d 'Show server details' complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a get -d 'Show server details'
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'add' -d 'Add an MCP server' complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a add -d 'Add an MCP server'
complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a 'remove' -d 'Remove an MCP server' complete -c copilot -n '__fish_seen_subcommand_from mcp' -f -a remove -d 'Remove an MCP server'
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from list' -l json -f -d 'Output as JSON' complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from list' -l json -f -d 'Output as JSON'
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l json -f -d 'Output as JSON' complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l json -f -d 'Output as JSON'
complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l show-secrets -f -d 'Show full environment variable and header values (masked by default)' complete -c copilot -n '__fish_seen_subcommand_from mcp; and __fish_seen_subcommand_from get' -l show-secrets -f -d 'Show full environment variable and header values (masked by default)'
+44 -44
View File
@@ -24,15 +24,15 @@ function __fish_deadbranch_using_subcommand
contains -- $cmd[1] $argv contains -- $cmd[1] $argv
end end
complete -c deadbranch -n "__fish_deadbranch_needs_command" -s h -l help -d 'Print help' complete -c deadbranch -n __fish_deadbranch_needs_command -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -s V -l version -d 'Print version' complete -c deadbranch -n __fish_deadbranch_needs_command -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "list" -d 'List stale branches' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a list -d 'List stale branches'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "clean" -d 'Delete stale branches (merged only by default, use --force for unmerged)' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a clean -d 'Delete stale branches (merged only by default, use --force for unmerged)'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "config" -d 'Manage configuration' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a config -d 'Manage configuration'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "backup" -d 'Manage backups' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a backup -d 'Manage backups'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "stats" -d 'Show repository branch statistics' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a stats -d 'Show repository branch statistics'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "completions" -d 'Generate shell completion scripts' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a completions -d 'Generate shell completion scripts'
complete -c deadbranch -n "__fish_deadbranch_needs_command" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c deadbranch -n __fish_deadbranch_needs_command -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand list" -s d -l days -d 'Only show branches older than N days (default: from config or 30)' -r complete -c deadbranch -n "__fish_deadbranch_using_subcommand list" -s d -l days -d 'Only show branches older than N days (default: from config or 30)' -r
complete -c deadbranch -n "__fish_deadbranch_using_subcommand list" -l local -d 'Only show local branches' complete -c deadbranch -n "__fish_deadbranch_using_subcommand list" -l local -d 'Only show local branches'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand list" -l remote -d 'Only show remote branches' complete -c deadbranch -n "__fish_deadbranch_using_subcommand list" -l remote -d 'Only show remote branches'
@@ -51,11 +51,11 @@ complete -c deadbranch -n "__fish_deadbranch_using_subcommand clean" -s h -l hel
complete -c deadbranch -n "__fish_deadbranch_using_subcommand clean" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand clean" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a "set" -d 'Set a configuration value' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a set -d 'Set a configuration value'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a "show" -d 'Show current configuration' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a show -d 'Show current configuration'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a "edit" -d 'Open config file in $EDITOR' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a edit -d 'Open config file in $EDITOR'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a "reset" -d 'Reset configuration to defaults' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a reset -d 'Reset configuration to defaults'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and not __fish_seen_subcommand_from set show edit reset help" -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from set" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from set" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from set" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from set" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from show" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from show" -s h -l help -d 'Print help'
@@ -64,18 +64,18 @@ complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from edit" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from edit" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from reset" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from reset" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from reset" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from reset" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a "set" -d 'Set a configuration value' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a set -d 'Set a configuration value'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a "show" -d 'Show current configuration' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a show -d 'Show current configuration'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a "edit" -d 'Open config file in $EDITOR' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a edit -d 'Open config file in $EDITOR'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a "reset" -d 'Reset configuration to defaults' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a reset -d 'Reset configuration to defaults'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c deadbranch -n "__fish_deadbranch_using_subcommand config; and __fish_seen_subcommand_from help" -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a "list" -d 'List available backups' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a list -d 'List available backups'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a "restore" -d 'Restore a branch from backup' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a restore -d 'Restore a branch from backup'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a "stats" -d 'Show backup storage statistics' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a stats -d 'Show backup storage statistics'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a "clean" -d 'Remove old backups, keeping the most recent ones' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a clean -d 'Remove old backups, keeping the most recent ones'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and not __fish_seen_subcommand_from list restore stats clean help" -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from list" -l repo -d 'Show backups for a specific repository by name' -r complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from list" -l repo -d 'Show backups for a specific repository by name' -r
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from list" -l current -d 'Only show backups for current repository' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from list" -l current -d 'Only show backups for current repository'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from list" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from list" -s h -l help -d 'Print help'
@@ -94,28 +94,28 @@ complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from clean" -s y -l yes -d 'Skip confirmation prompt' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from clean" -s y -l yes -d 'Skip confirmation prompt'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from clean" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from clean" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from clean" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from clean" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a "list" -d 'List available backups' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a list -d 'List available backups'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a "restore" -d 'Restore a branch from backup' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a restore -d 'Restore a branch from backup'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a "stats" -d 'Show backup storage statistics' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a stats -d 'Show backup storage statistics'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a "clean" -d 'Remove old backups, keeping the most recent ones' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a clean -d 'Remove old backups, keeping the most recent ones'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c deadbranch -n "__fish_deadbranch_using_subcommand backup; and __fish_seen_subcommand_from help" -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand stats" -s d -l days -d 'Treat branches older than N days as stale (default: from config or 30)' -r complete -c deadbranch -n "__fish_deadbranch_using_subcommand stats" -s d -l days -d 'Treat branches older than N days as stale (default: from config or 30)' -r
complete -c deadbranch -n "__fish_deadbranch_using_subcommand stats" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand stats" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand stats" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand stats" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand completions" -s h -l help -d 'Print help' complete -c deadbranch -n "__fish_deadbranch_using_subcommand completions" -s h -l help -d 'Print help'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand completions" -s V -l version -d 'Print version' complete -c deadbranch -n "__fish_deadbranch_using_subcommand completions" -s V -l version -d 'Print version'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "list" -d 'List stale branches' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a list -d 'List stale branches'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "clean" -d 'Delete stale branches (merged only by default, use --force for unmerged)' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a clean -d 'Delete stale branches (merged only by default, use --force for unmerged)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "config" -d 'Manage configuration' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a config -d 'Manage configuration'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "backup" -d 'Manage backups' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a backup -d 'Manage backups'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "stats" -d 'Show repository branch statistics' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a stats -d 'Show repository branch statistics'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "completions" -d 'Generate shell completion scripts' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a completions -d 'Generate shell completion scripts'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a "help" -d 'Print this message or the help of the given subcommand(s)' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and not __fish_seen_subcommand_from list clean config backup stats completions help" -f -a help -d 'Print this message or the help of the given subcommand(s)'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a "set" -d 'Set a configuration value' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a set -d 'Set a configuration value'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a "show" -d 'Show current configuration' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a show -d 'Show current configuration'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a "edit" -d 'Open config file in $EDITOR' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a edit -d 'Open config file in $EDITOR'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a "reset" -d 'Reset configuration to defaults' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from config" -f -a reset -d 'Reset configuration to defaults'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a "list" -d 'List available backups' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a list -d 'List available backups'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a "restore" -d 'Restore a branch from backup' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a restore -d 'Restore a branch from backup'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a "stats" -d 'Show backup storage statistics' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a stats -d 'Show backup storage statistics'
complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a "clean" -d 'Remove old backups, keeping the most recent ones' complete -c deadbranch -n "__fish_deadbranch_using_subcommand help; and __fish_seen_subcommand_from backup" -f -a clean -d 'Remove old backups, keeping the most recent ones'
+4 -5
View File
@@ -3,7 +3,7 @@
function __ov_debug function __ov_debug
set -l file "$BASH_COMP_DEBUG_FILE" set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file" if test -n "$file"
echo "$argv" >> $file echo "$argv" >>$file
end end
end end
@@ -108,7 +108,6 @@ function __ov_requires_order_preservation
return 1 return 1
end end
# This function does two things: # This function does two things:
# - Obtain the completions and store them in the global __ov_comp_results # - Obtain the completions and store them in the global __ov_comp_results
# - Return false if file completion should be performed # - Return false if file completion should be performed
@@ -215,18 +214,18 @@ end
# so we can properly delete any completions provided by another script. # so we can properly delete any completions provided by another script.
# Only do this if the program can be found, or else fish may print some errors; besides, # Only do this if the program can be found, or else fish may print some errors; besides,
# the existing completions will only be loaded if the program can be found. # the existing completions will only be loaded if the program can be found.
if type -q "ov" if type -q ov
# The space after the program name is essential to trigger completion for the program # The space after the program name is essential to trigger completion for the program
# and not completion of the program name itself. # and not completion of the program name itself.
# Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish. # Also, we use '> /dev/null 2>&1' since '&>' is not supported in older versions of fish.
complete --do-complete "ov " > /dev/null 2>&1 complete --do-complete "ov " >/dev/null 2>&1
end end
# Remove any pre-existing completions for the program since we will be handling all of them. # Remove any pre-existing completions for the program since we will be handling all of them.
complete -c ov -e complete -c ov -e
# this will get called after the two calls below and clear the $__ov_perform_completion_once_result global # this will get called after the two calls below and clear the $__ov_perform_completion_once_result global
complete -c ov -n '__ov_clear_perform_completion_once_result' complete -c ov -n __ov_clear_perform_completion_once_result
# The call to __ov_prepare_completions will setup __ov_comp_results # The call to __ov_prepare_completions will setup __ov_comp_results
# which provides the program's completion choices. # which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag # If this doesn't require order preservation, we don't use the -k flag
+2 -3
View File
@@ -21,7 +21,7 @@ end
function __tailscale_debug function __tailscale_debug
set -l file "$BASH_COMP_DEBUG_FILE" set -l file "$BASH_COMP_DEBUG_FILE"
if test -n "$file" if test -n "$file"
echo "$argv" >> $file echo "$argv" >>$file
end end
end end
@@ -125,7 +125,6 @@ function __tailscale_requires_order_preservation
return 1 return 1
end end
# This function does two things: # This function does two things:
# - Obtain the completions and store them in the global __tailscale_comp_results # - Obtain the completions and store them in the global __tailscale_comp_results
# - Return false if file completion should be performed # - Return false if file completion should be performed
@@ -242,7 +241,7 @@ end
complete -c tailscale -e complete -c tailscale -e
# this will get called after the two calls below and clear the $__tailscale_perform_completion_once_result global # this will get called after the two calls below and clear the $__tailscale_perform_completion_once_result global
complete -c tailscale -n '__tailscale_clear_perform_completion_once_result' complete -c tailscale -n __tailscale_clear_perform_completion_once_result
# The call to __tailscale_prepare_completions will setup __tailscale_comp_results # The call to __tailscale_prepare_completions will setup __tailscale_comp_results
# which provides the program's completion choices. # which provides the program's completion choices.
# If this doesn't require order preservation, we don't use the -k flag # If this doesn't require order preservation, we don't use the -k flag
+65 -66
View File
@@ -80,69 +80,68 @@ set -g __fish_config_op_registry_keys \
"zoxide:" "zoxide:"
set -g __fish_config_op_registry_values \ set -g __fish_config_op_registry_values \
"autoexec/venv" \ autoexec/venv \
"logging/terminal-capture" \ logging/terminal-capture \
"autoexec/sync" \ autoexec/sync \
"logging/multiplexer-capture" \ logging/multiplexer-capture \
"integrations/terminal-abbrs" \ integrations/terminal-abbrs \
"overrides/key-bindings" \ overrides/key-bindings \
"aliases/dev-tools" \ aliases/dev-tools \
"autoexec/sync" \ autoexec/sync \
"overrides/key-bindings" \ overrides/key-bindings \
"aliases/shell-tools" \ aliases/shell-tools \
"overrides/key-bindings" \ overrides/key-bindings \
"aliases/filesystem" \ aliases/filesystem \
"aliases/dev-tools" \ aliases/dev-tools \
"aliases/filesystem" \ aliases/filesystem \
"overrides/key-bindings" \ overrides/key-bindings \
"overrides/environment" \ overrides/environment \
"overrides/environment" \ overrides/environment \
"overrides/key-bindings" \ overrides/key-bindings \
"greeting/greeting-message" \ greeting/greeting-message \
"overrides/environment" \ overrides/environment \
"overrides/environment" \ overrides/environment \
"overrides/privacy" \ overrides/privacy \
"overrides/key-bindings" \ overrides/key-bindings \
"integrations/notifications" \ integrations/notifications \
"aliases/filesystem" \ aliases/filesystem \
"aliases/dev-tools" \ aliases/dev-tools \
"autoexec/plugin-management" \ autoexec/plugin-management \
"greeting/first-run" \ greeting/first-run \
"overrides/prompt" \ overrides/prompt \
"aliases/shell-tools" \ aliases/shell-tools \
"integrations/history-logs" \ integrations/history-logs \
"overrides/key-bindings" \ overrides/key-bindings \
"logging/terminal-capture" \ logging/terminal-capture \
"logging/terminal-capture" \ logging/terminal-capture \
"aliases/shell-tools" \ aliases/shell-tools \
"integrations/history-logs" \ integrations/history-logs \
"aliases/filesystem" \ aliases/filesystem \
"aliases/filesystem" \ aliases/filesystem \
"aliases/filesystem" \ aliases/filesystem \
"autoexec/pkg-wrappers" \ autoexec/pkg-wrappers \
"logging/pkg-logs" \ logging/pkg-logs \
"aliases/network" \ aliases/network \
"overrides/key-bindings" \ overrides/key-bindings \
"aliases/search" \ aliases/search \
"aliases/filesystem" \ aliases/filesystem \
"overrides/key-bindings" \ overrides/key-bindings \
"logging/terminal-capture" \ logging/terminal-capture \
"integrations/window-mgmt" \ integrations/window-mgmt \
"integrations/window-mgmt" \ integrations/window-mgmt \
"aliases/network" \ aliases/network \
"overrides/prompt" \ overrides/prompt \
"integrations/window-mgmt" \ integrations/window-mgmt \
"overrides/prompt" \ overrides/prompt \
"logging/multiplexer-capture" \ logging/multiplexer-capture \
"aliases/monitor" \ aliases/monitor \
"aliases/filesystem" \ aliases/filesystem \
"overrides/key-bindings" \ overrides/key-bindings \
"overrides/environment" \ overrides/environment \
"integrations/pkg-upgrade" \ integrations/pkg-upgrade \
"autoexec/telemetry" \ autoexec/telemetry \
"integrations/notifications" \ integrations/notifications \
"autoexec/pkg-wrappers" \ autoexec/pkg-wrappers \
"logging/pkg-logs" \ logging/pkg-logs \
"aliases/network" \ aliases/network \
"aliases/filesystem" aliases/filesystem
+6 -2
View File
@@ -17,7 +17,9 @@ function expand_bang_all --description 'Execute expand_bang_all'
__fish_config_op_enabled (status basename); or return 1 __fish_config_op_enabled (status basename); or return 1
set -l token $argv[1] set -l token $argv[1]
if test -z "$token"; set token (commandline -t); end if test -z "$token"
set token (commandline -t)
end
set -l tokens (string split -n " " -- $history[1]) set -l tokens (string split -n " " -- $history[1])
if test (count $tokens) -gt 1 if test (count $tokens) -gt 1
@@ -46,7 +48,9 @@ function expand_bang_minus_n --description 'Execute expand_bang_minus_n'
__fish_config_op_enabled (status basename); or return 1 __fish_config_op_enabled (status basename); or return 1
set -l token $argv[1] set -l token $argv[1]
if test -z "$token"; set token (commandline -t); end if test -z "$token"
set token (commandline -t)
end
# Extract the number from the regex match # Extract the number from the regex match
if string match -qr '!-(\d+)' -- "$token" if string match -qr '!-(\d+)' -- "$token"
+5 -6
View File
@@ -60,7 +60,7 @@ printf '%s\n' \
"cmd_str=\"$_paru_real\"" \ "cmd_str=\"$_paru_real\"" \
'for arg in "$@"; do' \ 'for arg in "$@"; do' \
' cmd_str+=" $(printf '"'"'%q'"'"' "$arg")"' \ ' cmd_str+=" $(printf '"'"'%q'"'"' "$arg")"' \
'done' \ done \
'script -q -e -c "$cmd_str" "$log_file"' \ 'script -q -e -c "$cmd_str" "$log_file"' \
'exit_code=$?' \ 'exit_code=$?' \
'' \ '' \
@@ -70,19 +70,18 @@ printf '%s\n' \
'cleaner="${XDG_CONFIG_HOME:-$HOME/.config}/fish/scripts/clean_progress_log.py"' \ 'cleaner="${XDG_CONFIG_HOME:-$HOME/.config}/fish/scripts/clean_progress_log.py"' \
'if command -v python3 >/dev/null 2>&1 && [[ -f "$cleaner" ]]; then' \ 'if command -v python3 >/dev/null 2>&1 && [[ -f "$cleaner" ]]; then' \
' python3 "$cleaner" < "$log_file" > "${log_file}.tmp" 2>/dev/null && mv "${log_file}.tmp" "$log_file" || rm -f "${log_file}.tmp"' \ ' python3 "$cleaner" < "$log_file" > "${log_file}.tmp" 2>/dev/null && mv "${log_file}.tmp" "$log_file" || rm -f "${log_file}.tmp"' \
'else' \ else \
' sed -i "/^Script \(started\|done\) on /d" "$log_file" 2>/dev/null || true' \ ' sed -i "/^Script \(started\|done\) on /d" "$log_file" 2>/dev/null || true' \
'fi' \ fi \
'' \ '' \
'max_files="${SCROLLBACK_HISTORY_MAX_FILES:-100}"' \ 'max_files="${SCROLLBACK_HISTORY_MAX_FILES:-100}"' \
'mapfile -t logs < <(ls -1t "$log_dir"/paru_*.log 2>/dev/null)' \ 'mapfile -t logs < <(ls -1t "$log_dir"/paru_*.log 2>/dev/null)' \
'excess=$(( ${#logs[@]} - max_files ))' \ 'excess=$(( ${#logs[@]} - max_files ))' \
'for (( i = ${#logs[@]} - 1; i >= ${#logs[@]} - excess && i >= 0; i-- )); do' \ 'for (( i = ${#logs[@]} - 1; i >= ${#logs[@]} - excess && i >= 0; i-- )); do' \
' rm -f "${logs[$i]}"' \ ' rm -f "${logs[$i]}"' \
'done' \ done \
'' \ '' \
'exit $exit_code' \ 'exit $exit_code' >$_paru_wrapper
> $_paru_wrapper
chmod +x $_paru_wrapper chmod +x $_paru_wrapper
+7 -6
View File
@@ -28,7 +28,7 @@ function __register_wakatime_fish_before_exec -e fish_postexec
set exec_command_str (string split -f1 ' ' "$argv") set exec_command_str (string split -f1 ' ' "$argv")
if test "$exec_command_str" = 'exit' if test "$exec_command_str" = exit
return 0 return 0
end end
@@ -38,19 +38,20 @@ function __register_wakatime_fish_before_exec -e fish_postexec
set -l project set -l project
set -l wakatime_path set -l wakatime_path
if type -p wakatime 2>&1 > /dev/null if type -p wakatime 2>&1 >/dev/null
set wakatime_path (type -p wakatime) set wakatime_path (type -p wakatime)
else if type -p ~/.wakatime/wakatime-cli 2>&1 > /dev/null else if type -p ~/.wakatime/wakatime-cli 2>&1 >/dev/null
set wakatime_path (type -p ~/.wakatime/wakatime-cli) set wakatime_path (type -p ~/.wakatime/wakatime-cli)
else else
return 1 return 1
end end
if git rev-parse --is-inside-work-tree &> /dev/null if git rev-parse --is-inside-work-tree &>/dev/null
set project (basename (git rev-parse --show-toplevel)) set project (basename (git rev-parse --show-toplevel))
else else
set project "Terminal" set project Terminal
end end
$wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity "$exec_command_str" &> /dev/null&; disown $wakatime_path --write --plugin "$PLUGIN_NAME/$PLUGIN_VERSION" --entity-type app --project "$project" --entity "$exec_command_str" &>/dev/null &
disown
end end
+5 -6
View File
@@ -60,7 +60,7 @@ printf '%s\n' \
"cmd_str=\"$_yay_real\"" \ "cmd_str=\"$_yay_real\"" \
'for arg in "$@"; do' \ 'for arg in "$@"; do' \
' cmd_str+=" $(printf '"'"'%q'"'"' "$arg")"' \ ' cmd_str+=" $(printf '"'"'%q'"'"' "$arg")"' \
'done' \ done \
'script -q -e -c "$cmd_str" "$log_file"' \ 'script -q -e -c "$cmd_str" "$log_file"' \
'exit_code=$?' \ 'exit_code=$?' \
'' \ '' \
@@ -70,19 +70,18 @@ printf '%s\n' \
'cleaner="${XDG_CONFIG_HOME:-$HOME/.config}/fish/scripts/clean_progress_log.py"' \ 'cleaner="${XDG_CONFIG_HOME:-$HOME/.config}/fish/scripts/clean_progress_log.py"' \
'if command -v python3 >/dev/null 2>&1 && [[ -f "$cleaner" ]]; then' \ 'if command -v python3 >/dev/null 2>&1 && [[ -f "$cleaner" ]]; then' \
' python3 "$cleaner" < "$log_file" > "${log_file}.tmp" 2>/dev/null && mv "${log_file}.tmp" "$log_file" || rm -f "${log_file}.tmp"' \ ' python3 "$cleaner" < "$log_file" > "${log_file}.tmp" 2>/dev/null && mv "${log_file}.tmp" "$log_file" || rm -f "${log_file}.tmp"' \
'else' \ else \
' sed -i "/^Script \(started\|done\) on /d" "$log_file" 2>/dev/null || true' \ ' sed -i "/^Script \(started\|done\) on /d" "$log_file" 2>/dev/null || true' \
'fi' \ fi \
'' \ '' \
'max_files="${SCROLLBACK_HISTORY_MAX_FILES:-100}"' \ 'max_files="${SCROLLBACK_HISTORY_MAX_FILES:-100}"' \
'mapfile -t logs < <(ls -1t "$log_dir"/yay_*.log 2>/dev/null)' \ 'mapfile -t logs < <(ls -1t "$log_dir"/yay_*.log 2>/dev/null)' \
'excess=$(( ${#logs[@]} - max_files ))' \ 'excess=$(( ${#logs[@]} - max_files ))' \
'for (( i = ${#logs[@]} - 1; i >= ${#logs[@]} - excess && i >= 0; i-- )); do' \ 'for (( i = ${#logs[@]} - 1; i >= ${#logs[@]} - excess && i >= 0; i-- )); do' \
' rm -f "${logs[$i]}"' \ ' rm -f "${logs[$i]}"' \
'done' \ done \
'' \ '' \
'exit $exit_code' \ 'exit $exit_code' >$_yay_wrapper
> $_yay_wrapper
chmod +x $_yay_wrapper chmod +x $_yay_wrapper
+3 -3
View File
@@ -28,9 +28,9 @@ function __config_settings_subcats --description 'List the sub-categories for on
case __fish_config_op_aliases case __fish_config_op_aliases
printf '%s\t%s\t%s\n' \ printf '%s\t%s\t%s\n' \
filesystem Filesystem "ls, cat, cd, du, mkdir, rm, mv, zoxide" \ filesystem Filesystem "ls, cat, cd, du, mkdir, rm, mv, zoxide" \
search Search "rg" \ search Search rg \
network Network "ping, ssh, yt-dlp" \ network Network "ping, ssh, yt-dlp" \
monitor Monitor "top" \ monitor Monitor top \
shell-tools Shell-tools "bash, less, help" \ shell-tools Shell-tools "bash, less, help" \
dev-tools Dev-tools "claude, edit, agy" dev-tools Dev-tools "claude, edit, agy"
case __fish_config_op_autoexec case __fish_config_op_autoexec
@@ -52,7 +52,7 @@ function __config_settings_subcats --description 'List the sub-categories for on
window-mgmt Window-mgmt "spwin, tab, split" \ window-mgmt Window-mgmt "spwin, tab, split" \
notifications Notifications "done, WakaTime hook" \ notifications Notifications "done, WakaTime hook" \
history-logs History-logs "hist, logs" \ history-logs History-logs "hist, logs" \
pkg-upgrade Pkg-upgrade "upgrade" pkg-upgrade Pkg-upgrade upgrade
case __fish_config_op_logging case __fish_config_op_logging
printf '%s\t%s\t%s\n' \ printf '%s\t%s\t%s\n' \
terminal-capture Term-capture "Kitty watcher, smart_exit scrollback" \ terminal-capture Term-capture "Kitty watcher, smart_exit scrollback" \
+13 -5
View File
@@ -75,7 +75,7 @@ function _fish_deps_install
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2] set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
if test -n "$_major"; and test "$_major" -lt 4 if test -n "$_major"; and test "$_major" -lt 4
set needs_install 1 set needs_install 1
set upgrade_label "Upgrade" set upgrade_label Upgrade
end end
end end
@@ -193,7 +193,9 @@ function _fish_deps_install
echo " Available methods:" echo " Available methods:"
set -l m 1 set -l m 1
for lbl in $method_labels for lbl in $method_labels
set_color brblack; echo -n " $m) "; set_color normal set_color brblack
echo -n " $m) "
set_color normal
echo $lbl echo $lbl
set m (math $m + 1) set m (math $m + 1)
end end
@@ -202,7 +204,9 @@ function _fish_deps_install
set chosen_method $methods[$_choice] set chosen_method $methods[$_choice]
end end
else else
set_color brblack; echo " "(string lower $upgrade_label)"ing via $method_labels[1]"; set_color normal set_color brblack
echo " "(string lower $upgrade_label)"ing via $method_labels[1]"
set_color normal
end end
# Execute chosen method # Execute chosen method
@@ -329,14 +333,18 @@ function _fish_deps_install
if test $status -eq 0 if test $status -eq 0
set installed_any 1 set installed_any 1
set_color green; echo " $bin "(string lower $upgrade_label)"ed."; set_color normal set_color green
echo " $bin "(string lower $upgrade_label)"ed."
set_color normal
if test "$bin" = fish if test "$bin" = fish
set_color yellow set_color yellow
echo " Fish upgraded — restart your shell to use the new version." echo " Fish upgraded — restart your shell to use the new version."
set_color normal set_color normal
end end
else else
set_color red; echo " $bin "(string lower $upgrade_label)" failed."; set_color normal set_color red
echo " $bin "(string lower $upgrade_label)" failed."
set_color normal
end end
end end
set i (math $i + 1) set i (math $i + 1)
+33 -11
View File
@@ -23,35 +23,57 @@ function _fish_deps_status
set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2] set -l _major (fish --version 2>&1 | string match -r 'version (\d+)')[2]
if test -n "$_major"; and test "$_major" -lt 4 if test -n "$_major"; and test "$_major" -lt 4
set -l _ver (fish --version 2>&1 | string replace 'fish, ' '') set -l _ver (fish --version 2>&1 | string replace 'fish, ' '')
set_color yellow; echo -n " ⚠ "; set_color normal set_color yellow
echo -n " ⚠ "
set_color normal
echo -n "$bin " echo -n "$bin "
set_color brblack; echo "($_ver — upgrade to 4.0+ required)"; set_color normal set_color brblack
echo "($_ver — upgrade to 4.0+ required)"
set_color normal
return return
end end
end end
set_color green; echo -n " ✓ "; set_color normal set_color green
echo -n " ✓ "
set_color normal
echo -n "$bin " echo -n "$bin "
set_color brblack; echo "(Found at "(__fish_real_command $bin)")"; set_color normal set_color brblack
echo "(Found at "(__fish_real_command $bin)")"
set_color normal
else if test "$tier" = req else if test "$tier" = req
set_color red; echo -n " ✗ "; set_color normal set_color red
echo -n " ✗ "
set_color normal
echo -n "$bin " echo -n "$bin "
set_color brblack; echo "(Not installed)"; set_color normal set_color brblack
echo "(Not installed)"
set_color normal
else if test "$tier" = rec else if test "$tier" = rec
set_color yellow; echo -n " ⚠ "; set_color normal set_color yellow
echo -n " ⚠ "
set_color normal
echo -n "$bin " echo -n "$bin "
set_color brblack; echo "(Not installed)"; set_color normal set_color brblack
echo "(Not installed)"
set_color normal
else else
# opt / term / int: absence is expected and not alarming # opt / term / int: absence is expected and not alarming
set_color brblack; echo -n " "; set_color normal set_color brblack
echo -n " "
set_color normal
echo -n "$bin " echo -n "$bin "
set_color brblack; echo "(Not installed)"; set_color normal set_color brblack
echo "(Not installed)"
set_color normal
end end
end end
for tier_label in "Required Dependencies:req" "Recommended Dependencies:rec" "Optional Dependencies:opt" "Terminal Emulators:term" "Integrations:int" for tier_label in "Required Dependencies:req" "Recommended Dependencies:rec" "Optional Dependencies:opt" "Terminal Emulators:term" "Integrations:int"
set -l label (string split : $tier_label)[1] set -l label (string split : $tier_label)[1]
set -l tier (string split : $tier_label)[2] set -l tier (string split : $tier_label)[2]
set_color cyan; echo $label; set_color normal set_color cyan
echo $label
set_color normal
set -l i 1 set -l i 1
for bin in $_fdc_bins for bin in $_fdc_bins
if test "$_fdc_tiers[$i]" = $tier if test "$_fdc_tiers[$i]" = $tier
+8 -4
View File
@@ -101,10 +101,14 @@ function _fish_deps_update
echo "Updating $bin..." echo "Updating $bin..."
set -l _arch (uname -m) set -l _arch (uname -m)
switch $_arch switch $_arch
case x86_64; set _arch amd64 case x86_64
case aarch64 arm64; set _arch arm64 set _arch amd64
case armv7l; set _arch arm case aarch64 arm64
case '*'; set _arch amd64 set _arch arm64
case armv7l
set _arch arm
case '*'
set _arch amd64
end end
set -l _zip "wakatime-cli-linux-$_arch.zip" set -l _zip "wakatime-cli-linux-$_arch.zip"
set -l _bin_src "wakatime-cli-linux-$_arch" set -l _bin_src "wakatime-cli-linux-$_arch"
-1
View File
@@ -7,4 +7,3 @@ function _puffer_fish_expand_bang
commandline --insert '!' commandline --insert '!'
end end
end end
+3 -3
View File
@@ -28,9 +28,9 @@ function _smart_execute --description 'Execute different functions based on the
# If it ends in =, run qalc; fall back to normal execute if qalc is absent # If it ends in =, run qalc; fall back to normal execute if qalc is absent
_qalc_eval; or commandline -f execute _qalc_eval; or commandline -f execute
# case 'g *' # case 'g *'
# # EXAMPLE FUTURE EXTENSION # # EXAMPLE FUTURE EXTENSION
# _some_git_helper # _some_git_helper
case '*' case '*'
# Default: execute the command line as-is # Default: execute the command line as-is
+2 -4
View File
@@ -893,8 +893,7 @@ function agents-vault --description 'track curated agent memory in a host-scoped
command cp -rn "$stash/." "$entry/" 2>/dev/null command cp -rn "$stash/." "$entry/" 2>/dev/null
rm -rf "$stash" rm -rf "$stash"
end end
printf 'renamed: %s → %s (%s)\n' "$prev_slug" "$slug" (date -I) \ printf 'renamed: %s → %s (%s)\n' "$prev_slug" "$slug" (date -I) >>"$entry/origin"
>>"$entry/origin"
# Only a link is dropped here, and only so the relink below has # Only a link is dropped here, and only so the relink below has
# somewhere to put the new one. Usually $live is exactly that: a # somewhere to put the new one. Usually $live is exactly that: a
# symlink at the old entry, now dangling. But the migration is # symlink at the old entry, now dangling. But the migration is
@@ -1078,8 +1077,7 @@ function agents-vault --description 'track curated agent memory in a host-scoped
end end
set -l reached 1 set -l reached 1
if git -C "$vault" rev-parse --abbrev-ref --symbolic-full-name '@{u}' >/dev/null 2>&1 if git -C "$vault" rev-parse --abbrev-ref --symbolic-full-name '@{u}' >/dev/null 2>&1
if not $gitnet git -C "$vault" pull --rebase --autostash -q \ if not $gitnet git -C "$vault" pull --rebase --autostash -q >/dev/null 2>/dev/null
>/dev/null 2>/dev/null
# Two unrelated failures land here and reporting them as # Two unrelated failures land here and reporting them as
# one sends the user hunting for a conflict that never # one sends the user hunting for a conflict that never
# existed. A rebase that genuinely started and stopped # existed. A rebase that genuinely started and stopped
+4 -4
View File
@@ -52,10 +52,10 @@ function agy --wraps=agy --description 'agy wrapper: auto-initializes AGENTS/ su
agents-vault --quiet agents-vault --quiet
for i in (seq (count $argv)) for i in (seq (count $argv))
if test "$argv[$i]" = "-r" if test "$argv[$i]" = -r
set argv[$i] "-c" set argv[$i] -c
else if test "$argv[$i]" = "--resume" else if test "$argv[$i]" = --resume
set argv[$i] "--continue" set argv[$i] --continue
else if string match -q -- "--resume=*" "$argv[$i]" else if string match -q -- "--resume=*" "$argv[$i]"
set argv[$i] (string replace -- "--resume=" "--continue=" "$argv[$i]") set argv[$i] (string replace -- "--resume=" "--continue=" "$argv[$i]")
end end
+13 -4
View File
@@ -25,11 +25,20 @@
function bd-pull --description 'Pull new Gitea issues into local Beads and link them' function bd-pull --description 'Pull new Gitea issues into local Beads and link them'
__fish_help_header (status current-function) $argv; and return 0 __fish_help_header (status current-function) $argv; and return 0
if not set -q argv[1]; echo "Need repo owner/name"; return 1; end if not set -q argv[1]
if not set -q GITEA_TOKEN; echo "\$GITEA_TOKEN not set"; return 1; end echo "Need repo owner/name"
return 1
end
if not set -q GITEA_TOKEN
echo "\$GITEA_TOKEN not set"
return 1
end
set -l REPO $argv[1] set -l REPO $argv[1]
if not set -q GITEA_URL; echo "\$GITEA_URL not set"; return 1; end if not set -q GITEA_URL
echo "\$GITEA_URL not set"
return 1
end
set -l IMPORT_COUNT 0 set -l IMPORT_COUNT 0
echo (set_color blue)"📡 Checking Gitea: $REPO..."(set_color normal) echo (set_color blue)"📡 Checking Gitea: $REPO..."(set_color normal)
@@ -63,7 +72,7 @@ function bd-pull --description 'Pull new Gitea issues into local Beads and link
curl -s -X PATCH -H "Authorization: token $GITEA_TOKEN" \ curl -s -X PATCH -H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"title\":\"$new_title\"}" \ -d "{\"title\":\"$new_title\"}" \
"$GITEA_URL/api/v1/repos/$REPO/issues/$number" > /dev/null "$GITEA_URL/api/v1/repos/$REPO/issues/$number" >/dev/null
set IMPORT_COUNT (math $IMPORT_COUNT + 1) set IMPORT_COUNT (math $IMPORT_COUNT + 1)
end end
+2 -2
View File
@@ -23,8 +23,8 @@ function cleanup --description 'Log orphans to ~/.removed_orphans and remove the
set -l orphans (pacman -Qtdq) set -l orphans (pacman -Qtdq)
if test -n "$orphans" if test -n "$orphans"
echo "📝 Logging orphans to ~/.removed_orphans..." echo "📝 Logging orphans to ~/.removed_orphans..."
echo "--- Removed on $(date) ---" >> ~/.removed_orphans echo "--- Removed on $(date) ---" >>~/.removed_orphans
pacman -Qi $orphans | grep -E '^(Name|Version)' >> ~/.removed_orphans pacman -Qi $orphans | grep -E '^(Name|Version)' >>~/.removed_orphans
echo "🧹 Removing orphans..." echo "🧹 Removing orphans..."
sudo pacman -Rns $orphans sudo pacman -Rns $orphans
+5 -6
View File
@@ -135,11 +135,11 @@ function logs --description 'Browse terminal log files interactively with fzf'
set -l togglescript (mktemp) set -l togglescript (mktemp)
set -l deletescript (mktemp) set -l deletescript (mktemp)
set -l helpflag "$tmpfile.help" set -l helpflag "$tmpfile.help"
printf '%s\n' $fzf_lines > $tmpfile printf '%s\n' $fzf_lines >$tmpfile
printf 'Terminal Logs — Key Bindings\n\n Enter View selected log in pager\n Ctrl-E Edit selected log in editor\n Ctrl-D Delete selected log\n Ctrl-C Quit\n ? Toggle this help\n\nFiltering:\n Type to fuzzy-filter by date or category\n Use -c flag to limit: scrollback, paru, yay' > $helpfile printf 'Terminal Logs — Key Bindings\n\n Enter View selected log in pager\n Ctrl-E Edit selected log in editor\n Ctrl-D Delete selected log\n Ctrl-C Quit\n ? Toggle this help\n\nFiltering:\n Type to fuzzy-filter by date or category\n Use -c flag to limit: scrollback, paru, yay' >$helpfile
# Help toggle script — avoids nested parens inside transform() # Help toggle script — avoids nested parens inside transform()
printf '#!/bin/sh\nif test -f %s; then\n rm -f %s\n printf "change-preview(command cat {1})"\nelse\n touch %s\n printf "change-preview(command cat %s)"\nfi\n' \ printf '#!/bin/sh\nif test -f %s; then\n rm -f %s\n printf "change-preview(command cat {1})"\nelse\n touch %s\n printf "change-preview(command cat %s)"\nfi\n' \
$helpflag $helpflag $helpflag $helpfile > $togglescript $helpflag $helpflag $helpflag $helpfile >$togglescript
chmod +x $togglescript chmod +x $togglescript
# Delete confirmation script — avoids nested parens inside execute(), and ensures # Delete confirmation script — avoids nested parens inside execute(), and ensures
# tmpfile is updated before +reload fires (execute is synchronous, execute-silent is not) # tmpfile is updated before +reload fires (execute is synchronous, execute-silent is not)
@@ -151,8 +151,7 @@ function logs --description 'Browse terminal log files interactively with fzf'
'case "$confirm" in [nN]) exit 0 ;; esac' \ 'case "$confirm" in [nN]) exit 0 ;; esac' \
"fish -c \"rm \$FILE\"" \ "fish -c \"rm \$FILE\"" \
"grep -vF \"\$FILE\" $tmpfile > $tmpfile.new" \ "grep -vF \"\$FILE\" $tmpfile > $tmpfile.new" \
"mv $tmpfile.new $tmpfile" \ "mv $tmpfile.new $tmpfile" >$deletescript
> $deletescript
chmod +x $deletescript chmod +x $deletescript
set -l selected (command cat $tmpfile | fzf \ set -l selected (command cat $tmpfile | fzf \
@@ -196,7 +195,7 @@ function logs --description 'Browse terminal log files interactively with fzf'
# is displayed without ov's default slateblue background, preserving # is displayed without ov's default slateblue background, preserving
# the original ANSI colors of the starship prompt. # the original ANSI colors of the starship prompt.
set -l ov_cfg (mktemp --suffix .yaml) set -l ov_cfg (mktemp --suffix .yaml)
printf 'Mode:\n scrollback:\n Style:\n SectionLine:\n Background: ""\n Foreground: ""\n' > $ov_cfg printf 'Mode:\n scrollback:\n Style:\n SectionLine:\n Background: ""\n Foreground: ""\n' >$ov_cfg
command ov --config $ov_cfg --view-mode scrollback \ command ov --config $ov_cfg --view-mode scrollback \
--section-delimiter '\x1b\]133;A' --section-header --section-header-num 1 $file --section-delimiter '\x1b\]133;A' --section-header --section-header-num 1 $file
rm -f $ov_cfg rm -f $ov_cfg
+64 -16
View File
@@ -187,28 +187,52 @@ function pkg --description 'Install or remove packages via the system package ma
switch $pm switch $pm
case paru yay case paru yay
$pm -S $to_install $pm -S $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case pacman case pacman
sudo pacman -S $to_install sudo pacman -S $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case apt case apt
sudo apt install -y $to_install sudo apt install -y $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case dnf case dnf
sudo dnf install -y $to_install sudo dnf install -y $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case zypper case zypper
sudo zypper install -y $to_install sudo zypper install -y $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case brew case brew
brew install $to_install brew install $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case pkg case pkg
sudo pkg install -y $to_install sudo pkg install -y $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case yum case yum
sudo yum install -y $to_install sudo yum install -y $to_install
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
end end
end end
@@ -217,28 +241,52 @@ function pkg --description 'Install or remove packages via the system package ma
switch $pm switch $pm
case paru yay case paru yay
$pm -Rns $to_remove $pm -Rns $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case pacman case pacman
sudo pacman -Rns $to_remove sudo pacman -Rns $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case apt case apt
sudo apt remove -y $to_remove sudo apt remove -y $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case dnf case dnf
sudo dnf remove -y $to_remove sudo dnf remove -y $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case zypper case zypper
sudo zypper remove -y $to_remove sudo zypper remove -y $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case brew case brew
brew uninstall $to_remove brew uninstall $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case pkg case pkg
sudo pkg delete -y $to_remove sudo pkg delete -y $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
case yum case yum
sudo yum remove -y $to_remove sudo yum remove -y $to_remove
or begin; functions -e __pkg_is_installed; return $status; end or begin
functions -e __pkg_is_installed
return $status
end
end end
end end
end end
+4 -4
View File
@@ -62,8 +62,8 @@ function rand_string --description 'Generate random, memorable strings from cura
return 0 return 0
end end
set -l sep "dash" set -l sep dash
set -l casing "lower" set -l casing lower
# Locate the words directory relative to this function # Locate the words directory relative to this function
set -l words_dir "" set -l words_dir ""
@@ -114,9 +114,9 @@ function rand_string --description 'Generate random, memorable strings from cura
set -l actual_sep $sep set -l actual_sep $sep
switch $sep switch $sep
case dash case dash
set actual_sep "-" set actual_sep -
case underscore case underscore
set actual_sep "_" set actual_sep _
case dot case dot
set actual_sep "." set actual_sep "."
case none empty case none empty
+1 -1
View File
@@ -38,7 +38,7 @@ function sbver --description 'Verifies Secure Boot status of EFI binaries using
# Flags # Flags
set brief_mode false set brief_mode false
if test "$argv[1]" = "--brief" if test "$argv[1]" = --brief
set brief_mode true set brief_mode true
end end
+1 -1
View File
@@ -23,7 +23,7 @@
# spark 1 1 2 5 14 42 # spark 1 1 2 5 14 42
# seq 64 | sort --random-sort | spark # seq 64 | sort --random-sort | spark
# echo "3 7 2 9 1" | spark # echo "3 7 2 9 1" | spark
function spark --description 'Sparklines' function spark --description Sparklines
argparse --ignore-unknown --name=spark v/version h/help m/min= M/max= -- $argv || return argparse --ignore-unknown --name=spark v/version h/help m/min= M/max= -- $argv || return
if set --query _flag_version[1] if set --query _flag_version[1]
+1 -1
View File
@@ -32,7 +32,7 @@ function sudo-toggle --description 'Toggle sudo password requirement on/off'
else else
# 2. Toggle is currently ON (Security active). We want to BYPASS it. # 2. Toggle is currently ON (Security active). We want to BYPASS it.
# We write a high-priority user-specific NOPASSWD rule. # We write a high-priority user-specific NOPASSWD rule.
echo "$USER ALL=(ALL:ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/nofail-toggle > /dev/null echo "$USER ALL=(ALL:ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/nofail-toggle >/dev/null
echo "🔓 Sudo security: DISABLED (Bypass active)" echo "🔓 Sudo security: DISABLED (Bypass active)"
end end
end end
+1 -1
View File
@@ -62,7 +62,7 @@ function yt-dlp --description 'yt-dlp with embedding + SponsorBlock defaults'
# --sponsorblock-remove all # --sponsorblock-remove all
# Skip if the user set their own remove (bare or --opt=value form), or # Skip if the user set their own remove (bare or --opt=value form), or
# disabled SponsorBlock entirely with --no-sponsorblock. # disabled SponsorBlock entirely with --no-sponsorblock.
if not string match -q -- '--sponsorblock-remove' $argv if not string match -q -- --sponsorblock-remove $argv
and not string match -q -- '--sponsorblock-remove=*' $argv and not string match -q -- '--sponsorblock-remove=*' $argv
and not contains -- --no-sponsorblock $argv and not contains -- --no-sponsorblock $argv
set -a extra --sponsorblock-remove all set -a extra --sponsorblock-remove all
+26 -22
View File
@@ -13,7 +13,6 @@
# - $FZF_ALT_C_COMMAND # - $FZF_ALT_C_COMMAND
# - $FZF_ALT_C_OPTS # - $FZF_ALT_C_OPTS
# Key bindings # Key bindings
# ------------ # ------------
# The oldest supported fish version is 3.1b1. To maintain compatibility, the # The oldest supported fish version is 3.1b1. To maintain compatibility, the
@@ -39,10 +38,10 @@ function fzf_key_bindings
set _fzf_transform_action bg-transform set _fzf_transform_action bg-transform
end end
#----BEGIN INCLUDE common.fish #----BEGIN INCLUDE common.fish
# NOTE: Do not directly edit this section, which is copied from "common.fish". # NOTE: Do not directly edit this section, which is copied from "common.fish".
# To modify it, one can edit "common.fish" and run "./update.sh" to apply # To modify it, one can edit "common.fish" and run "./update.sh" to apply
# the changes. See code comments in "common.fish" for the implementation details. # the changes. See code comments in "common.fish" for the implementation details.
function __fzf_defaults function __fzf_defaults
test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40% test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40%
@@ -56,10 +55,10 @@ function fzf_key_bindings
test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40% test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40%
if test -n "$FZF_TMUX_OPTS" if test -n "$FZF_TMUX_OPTS"
echo "fzf-tmux $FZF_TMUX_OPTS -- " echo "fzf-tmux $FZF_TMUX_OPTS -- "
else if test "$FZF_TMUX" = "1" else if test "$FZF_TMUX" = 1
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- " echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
else else
echo "fzf" echo fzf
end end
end end
@@ -85,10 +84,10 @@ function fzf_key_bindings
switch "$tokens[1]" switch "$tokens[1]"
case builtin command case builtin command
set -e -- tokens[1] set -e -- tokens[1]
test "$tokens[1]" = "--"; and set -e -- tokens[1] test "$tokens[1]" = --; and set -e -- tokens[1]
case env case env
set -e -- tokens[1] set -e -- tokens[1]
test "$tokens[1]" = "--"; and set -e -- tokens[1] test "$tokens[1]" = --; and set -e -- tokens[1]
while string match -qr -- '^[\w]+=' "$tokens[1]" while string match -qr -- '^[\w]+=' "$tokens[1]"
set -e -- tokens[1] set -e -- tokens[1]
end end
@@ -163,7 +162,7 @@ function fzf_key_bindings
string escape -n -- "$dir" "$fzf_query" "$prefix" string escape -n -- "$dir" "$fzf_query" "$prefix"
end end
#----END INCLUDE #----END INCLUDE
# Store current token in $dir as root for the 'find' command # Store current token in $dir as root for the 'find' command
function fzf-file-widget -d "List files and folders" function fzf-file-widget -d "List files and folders"
@@ -245,7 +244,7 @@ function fzf_key_bindings
\( "$v[3]" -gt 3 -o "$v[3]" -eq 3 -a \ \( "$v[3]" -gt 3 -o "$v[3]" -eq 3 -a \
\( -n "$v[4]" -a "$v[4]" -ge 3 \) \) \( -n "$v[4]" -a "$v[4]" -ge 3 \) \)
set -a -- FZF_DEFAULT_OPTS '--ansi' set -a -- FZF_DEFAULT_OPTS --ansi
set -a -- FZF_DEFAULT_COMMAND '--color=always' set -a -- FZF_DEFAULT_COMMAND '--color=always'
end end
@@ -321,10 +320,10 @@ fzf_key_bindings
function fzf_completion_setup function fzf_completion_setup
#----BEGIN INCLUDE common.fish #----BEGIN INCLUDE common.fish
# NOTE: Do not directly edit this section, which is copied from "common.fish". # NOTE: Do not directly edit this section, which is copied from "common.fish".
# To modify it, one can edit "common.fish" and run "./update.sh" to apply # To modify it, one can edit "common.fish" and run "./update.sh" to apply
# the changes. See code comments in "common.fish" for the implementation details. # the changes. See code comments in "common.fish" for the implementation details.
function __fzf_defaults function __fzf_defaults
test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40% test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40%
@@ -338,10 +337,10 @@ function fzf_completion_setup
test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40% test -n "$FZF_TMUX_HEIGHT"; or set -l FZF_TMUX_HEIGHT 40%
if test -n "$FZF_TMUX_OPTS" if test -n "$FZF_TMUX_OPTS"
echo "fzf-tmux $FZF_TMUX_OPTS -- " echo "fzf-tmux $FZF_TMUX_OPTS -- "
else if test "$FZF_TMUX" = "1" else if test "$FZF_TMUX" = 1
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- " echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
else else
echo "fzf" echo fzf
end end
end end
@@ -367,10 +366,10 @@ function fzf_completion_setup
switch "$tokens[1]" switch "$tokens[1]"
case builtin command case builtin command
set -e -- tokens[1] set -e -- tokens[1]
test "$tokens[1]" = "--"; and set -e -- tokens[1] test "$tokens[1]" = --; and set -e -- tokens[1]
case env case env
set -e -- tokens[1] set -e -- tokens[1]
test "$tokens[1]" = "--"; and set -e -- tokens[1] test "$tokens[1]" = --; and set -e -- tokens[1]
while string match -qr -- '^[\w]+=' "$tokens[1]" while string match -qr -- '^[\w]+=' "$tokens[1]"
set -e -- tokens[1] set -e -- tokens[1]
end end
@@ -445,13 +444,16 @@ function fzf_completion_setup
string escape -n -- "$dir" "$fzf_query" "$prefix" string escape -n -- "$dir" "$fzf_query" "$prefix"
end end
#----END INCLUDE #----END INCLUDE
# Use complete builtin for specific commands # Use complete builtin for specific commands
function __fzf_complete_native function __fzf_complete_native
set -l -- token (commandline -t) set -l -- token (commandline -t)
set -l -- completions (eval complete -C \"$argv[1]\") set -l -- completions (eval complete -C \"$argv[1]\")
test -n "$completions"; or begin commandline -f repaint; return; end test -n "$completions"; or begin
commandline -f repaint
return
end
# Calculate tabstop based on longest completion item (sample first 500 for performance) # Calculate tabstop based on longest completion item (sample first 500 for performance)
set -l -- tabstop 20 set -l -- tabstop 20
@@ -498,7 +500,9 @@ function fzf_completion_setup
set -lx FZF_DEFAULT_COMMAND set -lx FZF_DEFAULT_COMMAND
set -l -- fzf_query (commandline -t | string escape) set -l -- fzf_query (commandline -t | string escape)
set -l result set -l result
eval (__fzfcmd) --query=$fzf_query | while read -l r; set -a -- result $r; end eval (__fzfcmd) --query=$fzf_query | while read -l r
set -a -- result $r
end
and if functions -q $post_func and if functions -q $post_func
commandline -rt -- (string collect -- $result | eval $post_func $args[2] | string join ' ')' ' commandline -rt -- (string collect -- $result | eval $post_func $args[2] | string join ' ')' '
else else
+7 -4
View File
@@ -24,9 +24,12 @@ set -l mode bytes
set -l baseline main set -l baseline main
for i in (seq (count $argv)) for i in (seq (count $argv))
switch $argv[$i] switch $argv[$i]
case --structural; set mode structural case --structural
case --startup; set mode startup set mode structural
case --baseline; set baseline $argv[(math $i + 1)] case --startup
set mode startup
case --baseline
set baseline $argv[(math $i + 1)]
end end
end end
@@ -71,7 +74,7 @@ set -l cases \
"p --help" "pkg --help" "play-media --help" "qc --help" \ "p --help" "pkg --help" "play-media --help" "qc --help" \
"rand_string --help" "replay --help" "repo-open --help" "scrub --help" \ "rand_string --help" "replay --help" "repo-open --help" "scrub --help" \
"smart_exit --help" "spark --help" "y --help" \ "smart_exit --help" "spark --help" "y --help" \
"mkcd" "auto-pull remove __no_such_repo__" \ mkcd "auto-pull remove __no_such_repo__" \
"agents-init --no-such-flag" "pkg __no_such_subcommand__" "agents-init --no-such-flag" "pkg __no_such_subcommand__"
function __pb_run --argument-names cfg stub cmd out function __pb_run --argument-names cfg stub cmd out
+1 -2
View File
@@ -160,8 +160,7 @@ if test (count $session_suites) -gt 0
__fish_config_op_autoexec=off \ __fish_config_op_autoexec=off \
FISH_CONFIG_TEST_ROOT=$repo_root \ FISH_CONFIG_TEST_ROOT=$repo_root \
FISH_CONFIG_TEST_COUNTS=$counts \ FISH_CONFIG_TEST_COUNTS=$counts \
fish -i -c "source $repo_root/tests/lib.fish; $srcs report" \ fish -i -c "source $repo_root/tests/lib.fish; $srcs report" 2>$err_file
2>$err_file
set -l session_status $status set -l session_status $status
set -l stderr_out (command cat $err_file) set -l stderr_out (command cat $err_file)
+197 -109
View File
@@ -70,7 +70,7 @@ function failing_shim --argument-names name match
'#!/bin/sh' \ '#!/bin/sh' \
'for a in "$@"; do' \ 'for a in "$@"; do' \
" case \"\$a\" in *$match*) exit 1 ;; esac" \ " case \"\$a\" in *$match*) exit 1 ;; esac" \
'done' \ done \
"exec $real \"\$@\"" >$d/$name "exec $real \"\$@\"" >$d/$name
chmod +x $d/$name chmod +x $d/$name
printf '%s\n' $d printf '%s\n' $d
@@ -166,7 +166,8 @@ git -C $r3 remote add upstream https://git.rootiest.dev/rootiest/fish-config.git
check "falls back to first remote" $want (_agents_repo_slug $r3) check "falls back to first remote" $want (_agents_repo_slug $r3)
# Slug sanitization test: special chars in fallback (local-) branch. # Slug sanitization test: special chars in fallback (local-) branch.
set -l dirt (mktemp -d); set -ga TMPDIRS $dirt set -l dirt (mktemp -d)
set -ga TMPDIRS $dirt
mkdir -p "$dirt/projects/My Project!" mkdir -p "$dirt/projects/My Project!"
git -C "$dirt/projects/My Project!" init -q git -C "$dirt/projects/My Project!" init -q
git -C "$dirt/projects/My Project!" config user.email t@t git -C "$dirt/projects/My Project!" config user.email t@t
@@ -179,7 +180,8 @@ check "sanitizes special chars in local slug" false "$has_bad_chars"
echo "" echo ""
echo "== _agents_repo_ensure_symlink ==" echo "== _agents_repo_ensure_symlink =="
set -l w (mktemp -d); set -ga TMPDIRS $w set -l w (mktemp -d)
set -ga TMPDIRS $w
mkdir -p $w/target $w/live mkdir -p $w/target $w/live
# Fresh link onto an empty live parent. # Fresh link onto an empty live parent.
@@ -200,7 +202,8 @@ check "refuses missing target" 1 (_agents_repo_ensure_symlink $w/live/f3 $w/nope
check "no dangling link left" false (test -L $w/live/f3; and echo true; or echo false) check "no dangling link left" false (test -L $w/live/f3; and echo true; or echo false)
# Non-destructive adoption: content on both sides, nothing overwritten. # Non-destructive adoption: content on both sides, nothing overwritten.
set -l a (mktemp -d); set -ga TMPDIRS $a set -l a (mktemp -d)
set -ga TMPDIRS $a
mkdir -p $a/vault $a/live/memory mkdir -p $a/vault $a/live/memory
echo vault-version >$a/vault/shared.md echo vault-version >$a/vault/shared.md
echo vault-only >$a/vault/vaultonly.md echo vault-only >$a/vault/vaultonly.md
@@ -213,7 +216,8 @@ check "adoption keeps vault-only file" vault-only (cat $a/vault/vaultonly.md)
check "adoption replaced dir with link" true (test -L $a/live/memory; and echo true; or echo false) check "adoption replaced dir with link" true (test -L $a/live/memory; and echo true; or echo false)
# Repins a link that points somewhere else. # Repins a link that points somewhere else.
set -l p (mktemp -d); set -ga TMPDIRS $p set -l p (mktemp -d)
set -ga TMPDIRS $p
mkdir -p $p/one $p/two mkdir -p $p/one $p/two
ln -s $p/one $p/link ln -s $p/one $p/link
_agents_repo_ensure_symlink $p/link $p/two >/dev/null _agents_repo_ensure_symlink $p/link $p/two >/dev/null
@@ -239,12 +243,14 @@ check "idempotent, silent" "" "$out"
# guarantee, and the old pull-first shape broke it: a failed fetch took # guarantee, and the old pull-first shape broke it: a failed fetch took
# the local commit down with it. The divergence is still built here so # the local commit down with it. The divergence is still built here so
# that guarantee is tested against the case that used to fail. # that guarantee is tested against the case that used to fail.
set -l origin (mktemp -d); set -ga TMPDIRS $origin set -l origin (mktemp -d)
set -ga TMPDIRS $origin
git -C $origin init -q --bare git -C $origin init -q --bare
git -C $s remote add origin $origin git -C $s remote add origin $origin
git -C $s push -q -u origin HEAD:refs/heads/main 2>/dev/null git -C $s push -q -u origin HEAD:refs/heads/main 2>/dev/null
set -l clone (mktemp -d); set -ga TMPDIRS $clone set -l clone (mktemp -d)
set -ga TMPDIRS $clone
git clone -q $origin $clone git clone -q $origin $clone
git -C $clone config user.email t@t git -C $clone config user.email t@t
git -C $clone config user.name t git -C $clone config user.name t
@@ -297,7 +303,8 @@ set -l h (new_repo)
echo first >$h/a.md echo first >$h/a.md
_agents_repo_sync $h "chore: init" >/dev/null _agents_repo_sync $h "chore: init" >/dev/null
set -l hooks (mktemp -d); set -ga TMPDIRS $hooks set -l hooks (mktemp -d)
set -ga TMPDIRS $hooks
printf '#!/bin/sh\nexit 1\n' >$hooks/pre-commit printf '#!/bin/sh\nexit 1\n' >$hooks/pre-commit
chmod +x $hooks/pre-commit chmod +x $hooks/pre-commit
git -C $h config core.hooksPath $hooks git -C $h config core.hooksPath $hooks
@@ -312,8 +319,10 @@ check "commit hook rejection commits nothing" $before_hook_count (git -C $h rev-
echo "" echo ""
echo "== agents-vault (scaffold + link) ==" echo "== agents-vault (scaffold + link) =="
set -l vroot (mktemp -d); set -ga TMPDIRS $vroot set -l vroot (mktemp -d)
set -l croot (mktemp -d); set -ga TMPDIRS $croot set -ga TMPDIRS $vroot
set -l croot (mktemp -d)
set -ga TMPDIRS $croot
set -g __fish_agent_vault_dir $vroot/agent-vault set -g __fish_agent_vault_dir $vroot/agent-vault
set -g __fish_agent_vault_claude_root $croot set -g __fish_agent_vault_claude_root $croot
@@ -359,8 +368,10 @@ set -e __fish_agent_vault_claude_root
echo "" echo ""
echo "== agents-vault (emergent restore) ==" echo "== agents-vault (emergent restore) =="
set -l vroot2 (mktemp -d); set -ga TMPDIRS $vroot2 set -l vroot2 (mktemp -d)
set -l croot2 (mktemp -d); set -ga TMPDIRS $croot2 set -ga TMPDIRS $vroot2
set -l croot2 (mktemp -d)
set -ga TMPDIRS $croot2
set -g __fish_agent_vault_dir $vroot2/agent-vault set -g __fish_agent_vault_dir $vroot2/agent-vault
set -g __fish_agent_vault_claude_root $croot2 set -g __fish_agent_vault_claude_root $croot2
@@ -393,8 +404,10 @@ set -e __fish_agent_vault_claude_root
echo "" echo ""
echo "== agents-vault (link failure surfaces as exit 1) ==" echo "== agents-vault (link failure surfaces as exit 1) =="
set -l vroot3 (mktemp -d); set -ga TMPDIRS $vroot3 set -l vroot3 (mktemp -d)
set -l croot3 (mktemp -d); set -ga TMPDIRS $croot3 set -ga TMPDIRS $vroot3
set -l croot3 (mktemp -d)
set -ga TMPDIRS $croot3
set -g __fish_agent_vault_dir $vroot3/agent-vault set -g __fish_agent_vault_dir $vroot3/agent-vault
set -g __fish_agent_vault_claude_root $croot3 set -g __fish_agent_vault_claude_root $croot3
@@ -420,8 +433,10 @@ set -e __fish_agent_vault_claude_root
echo "" echo ""
echo "== agents-vault (slug migration) ==" echo "== agents-vault (slug migration) =="
set -l vroot2 (mktemp -d); set -ga TMPDIRS $vroot2 set -l vroot2 (mktemp -d)
set -l croot2 (mktemp -d); set -ga TMPDIRS $croot2 set -ga TMPDIRS $vroot2
set -l croot2 (mktemp -d)
set -ga TMPDIRS $croot2
set -g __fish_agent_vault_dir $vroot2/agent-vault set -g __fish_agent_vault_dir $vroot2/agent-vault
set -g __fish_agent_vault_claude_root $croot2 set -g __fish_agent_vault_claude_root $croot2
@@ -429,7 +444,7 @@ set -g __fish_agent_vault_claude_root $croot2
set -l mp (new_repo) set -l mp (new_repo)
set -l mmangled (string replace -a '/' '-' -- $mp | string replace -a '.' '-') set -l mmangled (string replace -a '/' '-' -- $mp | string replace -a '.' '-')
mkdir -p $croot2/$mmangled/memory mkdir -p $croot2/$mmangled/memory
echo "precious" >$croot2/$mmangled/memory/keep.md echo precious >$croot2/$mmangled/memory/keep.md
pushd $mp >/dev/null pushd $mp >/dev/null
agents-vault --silent agents-vault --silent
@@ -495,8 +510,7 @@ set -l enew_slug git.rootiest.dev-rootiest-emptycase
# hand-built shape is covered separately just below. # hand-built shape is covered separately just below.
mkdir -p $vroot2/agent-vault/projects/$enew_slug mkdir -p $vroot2/agent-vault/projects/$enew_slug
printf 'remote: %s\npath: %s\nhost: %s\n' \ printf 'remote: %s\npath: %s\nhost: %s\n' \
https://git.rootiest.dev/rootiest/emptycase.git /gone/elsewhere othermachine \ https://git.rootiest.dev/rootiest/emptycase.git /gone/elsewhere othermachine >$vroot2/agent-vault/projects/$enew_slug/origin
>$vroot2/agent-vault/projects/$enew_slug/origin
pushd $emp >/dev/null pushd $emp >/dev/null
set -l erc (agents-vault --silent 2>/dev/null; echo $status) set -l erc (agents-vault --silent 2>/dev/null; echo $status)
@@ -579,7 +593,8 @@ check "removal: old remote entry removed" false (test -d $vroot2/agent-vault/pro
# still find and adopt it. Before the fix, the fallback only lowercased # still find and adopt it. Before the fix, the fallback only lowercased
# the basename instead of sanitizing it like _agents_repo_slug does, so it # the basename instead of sanitizing it like _agents_repo_slug does, so it
# could never match the real entry directory for a name like this. # could never match the real entry directory for a name like this.
set -l dirty_root (mktemp -d); set -ga TMPDIRS $dirty_root set -l dirty_root (mktemp -d)
set -ga TMPDIRS $dirty_root
set -l dp "$dirty_root/My Project!" set -l dp "$dirty_root/My Project!"
mkdir -p "$dp" mkdir -p "$dp"
git -C "$dp" init -q git -C "$dp" init -q
@@ -590,7 +605,7 @@ git -C "$dp" config core.hooksPath /dev/null
set -l dmangled (string replace -a '/' '-' -- $dp | string replace -a '.' '-') set -l dmangled (string replace -a '/' '-' -- $dp | string replace -a '.' '-')
mkdir -p $croot2/$dmangled/memory mkdir -p $croot2/$dmangled/memory
echo "dirty-precious" >$croot2/$dmangled/memory/keep.md echo dirty-precious >$croot2/$dmangled/memory/keep.md
pushd $dp >/dev/null pushd $dp >/dev/null
agents-vault --silent agents-vault --silent
@@ -621,7 +636,8 @@ check "fallback old entry removed" false (test -d $vroot2/agent-vault/projects/$
# is not: a --silent run that did the right thing and returned 0 still # is not: a --silent run that did the right thing and returned 0 still
# printed "rm: cannot remove ...: Is a directory", which is the only # printed "rm: cannot remove ...: Is a directory", which is the only
# thing the user sees and reads as a failure. # thing the user sees and reads as a failure.
set -l real_root (mktemp -d); set -ga TMPDIRS $real_root set -l real_root (mktemp -d)
set -ga TMPDIRS $real_root
set -l rp "$real_root/proj" set -l rp "$real_root/proj"
mkdir -p "$rp" mkdir -p "$rp"
git -C "$rp" init -q git -C "$rp" init -q
@@ -632,7 +648,7 @@ git -C "$rp" config core.hooksPath /dev/null
set -l rmangled (string replace -a '/' '-' -- $rp | string replace -a '.' '-') set -l rmangled (string replace -a '/' '-' -- $rp | string replace -a '.' '-')
mkdir -p $croot2/$rmangled/memory mkdir -p $croot2/$rmangled/memory
echo "banked" >$croot2/$rmangled/memory/old.md echo banked >$croot2/$rmangled/memory/old.md
pushd $rp >/dev/null pushd $rp >/dev/null
agents-vault --silent agents-vault --silent
@@ -643,10 +659,11 @@ popd >/dev/null
# never seen, then change the slug so the migration runs. # never seen, then change the slug so the migration runs.
rm -f $croot2/$rmangled/memory rm -f $croot2/$rmangled/memory
mkdir -p $croot2/$rmangled/memory mkdir -p $croot2/$rmangled/memory
echo "written-live" >$croot2/$rmangled/memory/fresh.md echo written-live >$croot2/$rmangled/memory/fresh.md
git -C $rp remote add origin https://git.rootiest.dev/rootiest/realdir.git git -C $rp remote add origin https://git.rootiest.dev/rootiest/realdir.git
set -l rerr (mktemp); set -ga TMPDIRS $rerr set -l rerr (mktemp)
set -ga TMPDIRS $rerr
pushd $rp >/dev/null pushd $rp >/dev/null
set -l real_rc (agents-vault --silent 2>$rerr; echo $status) set -l real_rc (agents-vault --silent 2>$rerr; echo $status)
popd >/dev/null popd >/dev/null
@@ -673,8 +690,10 @@ echo ""
echo "== agents-vault (a real git clone) ==" echo "== agents-vault (a real git clone) =="
# Machine A: populate a vault and let agents-vault commit it. # Machine A: populate a vault and let agents-vault commit it.
set -l cl_vroot (mktemp -d); set -ga TMPDIRS $cl_vroot set -l cl_vroot (mktemp -d)
set -l cl_croot (mktemp -d); set -ga TMPDIRS $cl_croot set -ga TMPDIRS $cl_vroot
set -l cl_croot (mktemp -d)
set -ga TMPDIRS $cl_croot
set -g __fish_agent_vault_dir $cl_vroot/agent-vault set -g __fish_agent_vault_dir $cl_vroot/agent-vault
set -g __fish_agent_vault_claude_root $cl_croot set -g __fish_agent_vault_claude_root $cl_croot
@@ -698,7 +717,8 @@ agents-vault --silent
popd >/dev/null popd >/dev/null
# The clone, exactly as the README tells a user to make it. # The clone, exactly as the README tells a user to make it.
set -l cl_new (mktemp -d); set -ga TMPDIRS $cl_new set -l cl_new (mktemp -d)
set -ga TMPDIRS $cl_new
git clone -q $cl_vroot/agent-vault $cl_new/agent-vault git clone -q $cl_vroot/agent-vault $cl_new/agent-vault
git -C $cl_new/agent-vault config user.email t@t git -C $cl_new/agent-vault config user.email t@t
git -C $cl_new/agent-vault config user.name t git -C $cl_new/agent-vault config user.name t
@@ -709,7 +729,8 @@ check "clone: the empty entry has no claude/ subtree" false (test -d $cl_new/age
check "clone: the empty entry is its origin file alone" true (test -f $cl_new/agent-vault/projects/$cl_empty_slug/origin; and echo true; or echo false) check "clone: the empty entry is its origin file alone" true (test -f $cl_new/agent-vault/projects/$cl_empty_slug/origin; and echo true; or echo false)
# Machine B, case 1: an ordinary run against the clone restores memory. # Machine B, case 1: an ordinary run against the clone restores memory.
set -l cl_croot2 (mktemp -d); set -ga TMPDIRS $cl_croot2 set -l cl_croot2 (mktemp -d)
set -ga TMPDIRS $cl_croot2
set -g __fish_agent_vault_dir $cl_new/agent-vault set -g __fish_agent_vault_dir $cl_new/agent-vault
set -g __fish_agent_vault_claude_root $cl_croot2 set -g __fish_agent_vault_claude_root $cl_croot2
@@ -762,10 +783,14 @@ set -e __fish_agent_vault_claude_root
echo "" echo ""
echo "== agents-vault (global state) ==" echo "== agents-vault (global state) =="
set -l vroot5 (mktemp -d); set -ga TMPDIRS $vroot5 set -l vroot5 (mktemp -d)
set -l croot5 (mktemp -d); set -ga TMPDIRS $croot5 set -ga TMPDIRS $vroot5
set -l chome5 (mktemp -d); set -ga TMPDIRS $chome5 set -l croot5 (mktemp -d)
set -l agy5 (mktemp -d); set -ga TMPDIRS $agy5 set -ga TMPDIRS $croot5
set -l chome5 (mktemp -d)
set -ga TMPDIRS $chome5
set -l agy5 (mktemp -d)
set -ga TMPDIRS $agy5
set -g __fish_agent_vault_dir $vroot5/agent-vault set -g __fish_agent_vault_dir $vroot5/agent-vault
set -g __fish_agent_vault_claude_root $croot5 set -g __fish_agent_vault_claude_root $croot5
set -g __fish_agent_vault_claude_home $chome5 set -g __fish_agent_vault_claude_home $chome5
@@ -802,7 +827,8 @@ printf 'transcript\n' >$agy5/knowledge/session.jsonl
# the store boundary has to hold on its own. $outside5 stands in for that # the store boundary has to hold on its own. $outside5 stands in for that
# home: a directory the store has no business reaching into, planted with # home: a directory the store has no business reaching into, planted with
# exactly the shapes that qualify. # exactly the shapes that qualify.
set -l outside5 (mktemp -d); set -ga TMPDIRS $outside5 set -l outside5 (mktemp -d)
set -ga TMPDIRS $outside5
mkdir -p $outside5/nested mkdir -p $outside5/nested
echo SECRET-OUTSIDE-KNOWLEDGE >$outside5/leaked.json echo SECRET-OUTSIDE-KNOWLEDGE >$outside5/leaked.json
echo SECRET-OUTSIDE-KNOWLEDGE >$outside5/target.md echo SECRET-OUTSIDE-KNOWLEDGE >$outside5/target.md
@@ -905,10 +931,14 @@ set -e __fish_agent_vault_claude_root
echo "" echo ""
echo "== agents-vault (global emergent restore) ==" echo "== agents-vault (global emergent restore) =="
set -l vroot6 (mktemp -d); set -ga TMPDIRS $vroot6 set -l vroot6 (mktemp -d)
set -l croot6 (mktemp -d); set -ga TMPDIRS $croot6 set -ga TMPDIRS $vroot6
set -l chome6 (mktemp -d); set -ga TMPDIRS $chome6 set -l croot6 (mktemp -d)
set -l agy6 (mktemp -d); set -ga TMPDIRS $agy6 set -ga TMPDIRS $croot6
set -l chome6 (mktemp -d)
set -ga TMPDIRS $chome6
set -l agy6 (mktemp -d)
set -ga TMPDIRS $agy6
set -g __fish_agent_vault_dir $vroot6/agent-vault set -g __fish_agent_vault_dir $vroot6/agent-vault
set -g __fish_agent_vault_claude_root $croot6 set -g __fish_agent_vault_claude_root $croot6
set -g __fish_agent_vault_claude_home $chome6 set -g __fish_agent_vault_claude_home $chome6
@@ -927,8 +957,10 @@ check "global restore: vault content readable through the link" restored-global
# A home with neither side populated must not have a memory/ invented for # A home with neither side populated must not have a memory/ invented for
# it: ~/.claude/memory does not exist by default. # it: ~/.claude/memory does not exist by default.
set -l chome7 (mktemp -d); set -ga TMPDIRS $chome7 set -l chome7 (mktemp -d)
set -l vroot7 (mktemp -d); set -ga TMPDIRS $vroot7 set -ga TMPDIRS $chome7
set -l vroot7 (mktemp -d)
set -ga TMPDIRS $vroot7
set -g __fish_agent_vault_dir $vroot7/agent-vault set -g __fish_agent_vault_dir $vroot7/agent-vault
set -g __fish_agent_vault_claude_home $chome7 set -g __fish_agent_vault_claude_home $chome7
set -l gp7 (new_repo https://git.rootiest.dev/rootiest/globals-absent.git) set -l gp7 (new_repo https://git.rootiest.dev/rootiest/globals-absent.git)
@@ -951,10 +983,14 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (global link failure is non-fatal) ==" echo "== agents-vault (global link failure is non-fatal) =="
set -l vroot8 (mktemp -d); set -ga TMPDIRS $vroot8 set -l vroot8 (mktemp -d)
set -l croot8 (mktemp -d); set -ga TMPDIRS $croot8 set -ga TMPDIRS $vroot8
set -l chome8 (mktemp -d); set -ga TMPDIRS $chome8 set -l croot8 (mktemp -d)
set -l agy8 (mktemp -d); set -ga TMPDIRS $agy8 set -ga TMPDIRS $croot8
set -l chome8 (mktemp -d)
set -ga TMPDIRS $chome8
set -l agy8 (mktemp -d)
set -ga TMPDIRS $agy8
set -g __fish_agent_vault_dir $vroot8/agent-vault set -g __fish_agent_vault_dir $vroot8/agent-vault
set -g __fish_agent_vault_claude_root $croot8 set -g __fish_agent_vault_claude_root $croot8
set -g __fish_agent_vault_claude_home $chome8 set -g __fish_agent_vault_claude_home $chome8
@@ -972,7 +1008,8 @@ set -l fmangled (string replace -a '/' '-' -- $fp | string replace -a '.' '-')
mkdir -p $croot8/$fmangled/memory mkdir -p $croot8/$fmangled/memory
echo project-memory >$croot8/$fmangled/memory/p.md echo project-memory >$croot8/$fmangled/memory/p.md
set -l ferr (mktemp); set -ga TMPDIRS $ferr set -l ferr (mktemp)
set -ga TMPDIRS $ferr
pushd $fp >/dev/null pushd $fp >/dev/null
set -l frc (agents-vault --silent 2>$ferr; echo $status) set -l frc (agents-vault --silent 2>$ferr; echo $status)
popd >/dev/null popd >/dev/null
@@ -991,7 +1028,8 @@ check "global link failure: per-project memory is committed" true (git -C $vroot
# A failed global link must not be recorded as done: the next run has to # A failed global link must not be recorded as done: the next run has to
# re-enter the block and warn again, not treat the vault as correct. # re-enter the block and warn again, not treat the vault as correct.
pushd $fp >/dev/null pushd $fp >/dev/null
set -l ferr2 (mktemp); set -ga TMPDIRS $ferr2 set -l ferr2 (mktemp)
set -ga TMPDIRS $ferr2
agents-vault --silent 2>$ferr2 agents-vault --silent 2>$ferr2
popd >/dev/null popd >/dev/null
check "global link failure: retried on the next run" true (string match -q "*$chome8/memory*" -- (cat $ferr2); and echo true; or echo false) check "global link failure: retried on the next run" true (string match -q "*$chome8/memory*" -- (cat $ferr2); and echo true; or echo false)
@@ -1008,17 +1046,22 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (status, remote, adopt) ==" echo "== agents-vault (status, remote, adopt) =="
set -l vroot9 (mktemp -d); set -ga TMPDIRS $vroot9 set -l vroot9 (mktemp -d)
set -l croot9 (mktemp -d); set -ga TMPDIRS $croot9 set -ga TMPDIRS $vroot9
set -l chome9 (mktemp -d); set -ga TMPDIRS $chome9 set -l croot9 (mktemp -d)
set -l agy9 (mktemp -d); set -ga TMPDIRS $agy9 set -ga TMPDIRS $croot9
set -l chome9 (mktemp -d)
set -ga TMPDIRS $chome9
set -l agy9 (mktemp -d)
set -ga TMPDIRS $agy9
set -g __fish_agent_vault_dir $vroot9/agent-vault set -g __fish_agent_vault_dir $vroot9/agent-vault
set -g __fish_agent_vault_claude_root $croot9 set -g __fish_agent_vault_claude_root $croot9
set -g __fish_agent_vault_claude_home $chome9 set -g __fish_agent_vault_claude_home $chome9
set -g __fish_agent_vault_agy_root $agy9 set -g __fish_agent_vault_agy_root $agy9
# A report asked for before the vault exists must say so, not scaffold one. # A report asked for before the vault exists must say so, not scaffold one.
set -l s0out (mktemp); set -ga TMPDIRS $s0out set -l s0out (mktemp)
set -ga TMPDIRS $s0out
set -l s0rc (agents-vault --status >$s0out; echo $status) set -l s0rc (agents-vault --status >$s0out; echo $status)
check "status without a vault exits 0" 0 "$s0rc" check "status without a vault exits 0" 0 "$s0rc"
check "status without a vault says so" true (string match -q '*no vault*' -- (cat $s0out); and echo true; or echo false) check "status without a vault says so" true (string match -q '*no vault*' -- (cat $s0out); and echo true; or echo false)
@@ -1068,7 +1111,8 @@ check "status reports the remote" true (string match -q '*rootiest/agent-vault.g
# A *failed* remote update must return non-zero. Reporting success after a # A *failed* remote update must return non-zero. Reporting success after a
# git command that did not run is the same silent-false-success shape that # git command that did not run is the same silent-false-success shape that
# a hook-rejected commit produced earlier in this project. # a hook-rejected commit produced earlier in this project.
set -l rerr (mktemp); set -ga TMPDIRS $rerr set -l rerr (mktemp)
set -ga TMPDIRS $rerr
set -l rshim (failing_shim git set-url) set -l rshim (failing_shim git set-url)
set -l rpath $PATH set -l rpath $PATH
set PATH $rshim $PATH set PATH $rshim $PATH
@@ -1106,10 +1150,11 @@ agents-vault --silent
popd >/dev/null popd >/dev/null
set -l projects_before (command ls -A $vroot9/agent-vault/projects | sort | string join ',') set -l projects_before (command ls -A $vroot9/agent-vault/projects | sort | string join ',')
set -l bad_slugs ../escape has/slash . .. 'UPPER' 'sp ace' '' set -l bad_slugs ../escape has/slash . .. UPPER 'sp ace' ''
pushd $bp >/dev/null pushd $bp >/dev/null
for bad in $bad_slugs for bad in $bad_slugs
set -l berr (mktemp); set -ga TMPDIRS $berr set -l berr (mktemp)
set -ga TMPDIRS $berr
set -l brc (agents-vault --adopt=$bad --silent 2>$berr; echo $status) set -l brc (agents-vault --adopt=$bad --silent 2>$berr; echo $status)
check "adopt refuses '$bad'" 1 "$brc" check "adopt refuses '$bad'" 1 "$brc"
check "adopt refuses '$bad' out loud" true (string match -q '*invalid*' -- (cat $berr); and echo true; or echo false) check "adopt refuses '$bad' out loud" true (string match -q '*invalid*' -- (cat $berr); and echo true; or echo false)
@@ -1150,7 +1195,8 @@ set -l pre_head (git -C $vroot9/agent-vault rev-list --count HEAD)
set -l pre_porcelain (git -C $vroot9/agent-vault status --porcelain | string join ',') set -l pre_porcelain (git -C $vroot9/agent-vault status --porcelain | string join ',')
set -l pre_link (path resolve $croot9/$tmang/memory) set -l pre_link (path resolve $croot9/$tmang/memory)
set -l terr (mktemp); set -ga TMPDIRS $terr set -l terr (mktemp)
set -ga TMPDIRS $terr
set -l tshim (failing_shim rm $tmang) set -l tshim (failing_shim rm $tmang)
set -l tpath $PATH set -l tpath $PATH
set PATH $tshim $PATH set PATH $tshim $PATH
@@ -1203,8 +1249,7 @@ popd >/dev/null
# The target must be *tracked* for this to bite: stashing it takes files # The target must be *tracked* for this to bite: stashing it takes files
# git knows about out from under the index, which is the whole hazard. # git knows about out from under the index, which is the whole hazard.
mkdir -p $vroot9/agent-vault/projects/stash-target/claude/memory mkdir -p $vroot9/agent-vault/projects/stash-target/claude/memory
printf 'remote: (none)\npath: %s\nhost: t\n' /nowhere \ printf 'remote: (none)\npath: %s\nhost: t\n' /nowhere >$vroot9/agent-vault/projects/stash-target/origin
>$vroot9/agent-vault/projects/stash-target/origin
pushd $sa >/dev/null pushd $sa >/dev/null
agents-vault --silent agents-vault --silent
popd >/dev/null popd >/dev/null
@@ -1245,8 +1290,7 @@ agents-vault --silent
popd >/dev/null popd >/dev/null
mkdir -p $vroot9/agent-vault/projects/stashfail-target/claude/memory mkdir -p $vroot9/agent-vault/projects/stashfail-target/claude/memory
printf 'remote: (none)\npath: %s\nhost: t\n' /nowhere-else \ printf 'remote: (none)\npath: %s\nhost: t\n' /nowhere-else >$vroot9/agent-vault/projects/stashfail-target/origin
>$vroot9/agent-vault/projects/stashfail-target/origin
pushd $sf >/dev/null pushd $sf >/dev/null
agents-vault --silent agents-vault --silent
popd >/dev/null popd >/dev/null
@@ -1257,7 +1301,8 @@ set -l sf_porcelain (git -C $vroot9/agent-vault status --porcelain | string join
set -l sf_link (path resolve $croot9/$sfmang/memory) set -l sf_link (path resolve $croot9/$sfmang/memory)
check "stash adopt rollback: vault clean before the adopt" "" "$sf_porcelain" check "stash adopt rollback: vault clean before the adopt" "" "$sf_porcelain"
set -l sferr (mktemp); set -ga TMPDIRS $sferr set -l sferr (mktemp)
set -ga TMPDIRS $sferr
set -l sfshim (failing_shim rm $sfmang) set -l sfshim (failing_shim rm $sfmang)
set -l sfpath $PATH set -l sfpath $PATH
set PATH $sfshim $PATH set PATH $sfshim $PATH
@@ -1359,10 +1404,14 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (restore) ==" echo "== agents-vault (restore) =="
set -l vroot10 (mktemp -d); set -ga TMPDIRS $vroot10 set -l vroot10 (mktemp -d)
set -l croot10 (mktemp -d); set -ga TMPDIRS $croot10 set -ga TMPDIRS $vroot10
set -l chome10 (mktemp -d); set -ga TMPDIRS $chome10 set -l croot10 (mktemp -d)
set -l agy10 (mktemp -d); set -ga TMPDIRS $agy10 set -ga TMPDIRS $croot10
set -l chome10 (mktemp -d)
set -ga TMPDIRS $chome10
set -l agy10 (mktemp -d)
set -ga TMPDIRS $agy10
set -g __fish_agent_vault_dir $vroot10/agent-vault set -g __fish_agent_vault_dir $vroot10/agent-vault
set -g __fish_agent_vault_claude_root $croot10 set -g __fish_agent_vault_claude_root $croot10
set -g __fish_agent_vault_claude_home $chome10 set -g __fish_agent_vault_claude_home $chome10
@@ -1389,9 +1438,9 @@ check "restore: names what it restored" true (string match -q '*restoreme*' -- "
# succeeds and says which entry needs --adopt. # succeeds and says which entry needs --adopt.
mkdir -p $vroot10/agent-vault/projects/ghost-entry/claude/memory mkdir -p $vroot10/agent-vault/projects/ghost-entry/claude/memory
echo x >$vroot10/agent-vault/projects/ghost-entry/claude/memory/x.md echo x >$vroot10/agent-vault/projects/ghost-entry/claude/memory/x.md
printf 'remote: (none)\npath: %s\nhost: t\n' $vroot10/gone-forever \ printf 'remote: (none)\npath: %s\nhost: t\n' $vroot10/gone-forever >$vroot10/agent-vault/projects/ghost-entry/origin
>$vroot10/agent-vault/projects/ghost-entry/origin set -l r2out (mktemp)
set -l r2out (mktemp); set -ga TMPDIRS $r2out set -ga TMPDIRS $r2out
set -l r2rc (agents-vault --restore >$r2out; echo $status) set -l r2rc (agents-vault --restore >$r2out; echo $status)
check "restore: exits 0 with an unplaceable entry" 0 "$r2rc" check "restore: exits 0 with an unplaceable entry" 0 "$r2rc"
check "restore: reports the unplaceable entry" true (string match -q '*ghost-entry*' -- (cat $r2out); and echo true; or echo false) check "restore: reports the unplaceable entry" true (string match -q '*ghost-entry*' -- (cat $r2out); and echo true; or echo false)
@@ -1406,8 +1455,7 @@ set -l dotp (new_repo https://git.rootiest.dev/rootiest/dotted.git)
set -l dotmang (string replace -a '/' '-' -- $dotp | string replace -a '.' '-') set -l dotmang (string replace -a '/' '-' -- $dotp | string replace -a '.' '-')
mkdir -p $vroot10/agent-vault/projects/.dot-entry/claude/memory mkdir -p $vroot10/agent-vault/projects/.dot-entry/claude/memory
echo dot-precious >$vroot10/agent-vault/projects/.dot-entry/claude/memory/keep.md echo dot-precious >$vroot10/agent-vault/projects/.dot-entry/claude/memory/keep.md
printf 'remote: (none)\npath: %s\nhost: t\n' $dotp \ printf 'remote: (none)\npath: %s\nhost: t\n' $dotp >$vroot10/agent-vault/projects/.dot-entry/origin
>$vroot10/agent-vault/projects/.dot-entry/origin
check "dot-led entry: a glob really does skip it" false (string match -q '*.dot-entry*' -- (echo $vroot10/agent-vault/projects/*); and echo true; or echo false) check "dot-led entry: a glob really does skip it" false (string match -q '*.dot-entry*' -- (echo $vroot10/agent-vault/projects/*); and echo true; or echo false)
set -l dotreport (agents-vault --status) set -l dotreport (agents-vault --status)
@@ -1425,7 +1473,8 @@ rm -f $croot10/$rmang/memory
set -l r3shim (failing_shim ln $rmang) set -l r3shim (failing_shim ln $rmang)
set -l r3path $PATH set -l r3path $PATH
set PATH $r3shim $PATH set PATH $r3shim $PATH
set -l r3err (mktemp); set -ga TMPDIRS $r3err set -l r3err (mktemp)
set -ga TMPDIRS $r3err
set -l r3rc (agents-vault --restore >/dev/null 2>$r3err; echo $status) set -l r3rc (agents-vault --restore >/dev/null 2>$r3err; echo $status)
set PATH $r3path set PATH $r3path
check "restore: a failed relink returns non-zero" 1 "$r3rc" check "restore: a failed relink returns non-zero" 1 "$r3rc"
@@ -1440,11 +1489,16 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (push) ==" echo "== agents-vault (push) =="
set -l vroot11 (mktemp -d); set -ga TMPDIRS $vroot11 set -l vroot11 (mktemp -d)
set -l croot11 (mktemp -d); set -ga TMPDIRS $croot11 set -ga TMPDIRS $vroot11
set -l chome11 (mktemp -d); set -ga TMPDIRS $chome11 set -l croot11 (mktemp -d)
set -l agy11 (mktemp -d); set -ga TMPDIRS $agy11 set -ga TMPDIRS $croot11
set -l bare (mktemp -d); set -ga TMPDIRS $bare set -l chome11 (mktemp -d)
set -ga TMPDIRS $chome11
set -l agy11 (mktemp -d)
set -ga TMPDIRS $agy11
set -l bare (mktemp -d)
set -ga TMPDIRS $bare
git init -q --bare $bare git init -q --bare $bare
set -g __fish_agent_vault_dir $vroot11/agent-vault set -g __fish_agent_vault_dir $vroot11/agent-vault
set -g __fish_agent_vault_claude_root $croot11 set -g __fish_agent_vault_claude_root $croot11
@@ -1459,7 +1513,8 @@ echo pushed >$croot11/$pmang/memory/p.md
# --push with no remote must fail loudly. The commit still happened, so # --push with no remote must fail loudly. The commit still happened, so
# silently returning 0 would read as "backed up off this machine". # silently returning 0 would read as "backed up off this machine".
set -l perr (mktemp); set -ga TMPDIRS $perr set -l perr (mktemp)
set -ga TMPDIRS $perr
pushd $pp >/dev/null pushd $pp >/dev/null
set -l prc0 (agents-vault --push --silent 2>$perr; echo $status) set -l prc0 (agents-vault --push --silent 2>$perr; echo $status)
popd >/dev/null popd >/dev/null
@@ -1498,7 +1553,8 @@ check "autopush pushes when enabled" pushed-auto (git -C $bare show $vbranch:pro
set -l deadremote $vroot11/not-a-repo.git set -l deadremote $vroot11/not-a-repo.git
agents-vault --remote=$deadremote --silent agents-vault --remote=$deadremote --silent
echo pushed-never >$croot11/$pmang/memory/p4.md echo pushed-never >$croot11/$pmang/memory/p4.md
set -l fperr (mktemp); set -ga TMPDIRS $fperr set -l fperr (mktemp)
set -ga TMPDIRS $fperr
pushd $pp >/dev/null pushd $pp >/dev/null
set -l fprc (agents-vault --push --silent 2>$fperr; echo $status) set -l fprc (agents-vault --push --silent 2>$fperr; echo $status)
popd >/dev/null popd >/dev/null
@@ -1510,7 +1566,8 @@ check "failing push still committed locally" true (git -C $vroot11/agent-vault l
# saying "Synced" must not come with a zero exit when the push failed. # saying "Synced" must not come with a zero exit when the push failed.
echo pushed-never-2 >$croot11/$pmang/memory/p5.md echo pushed-never-2 >$croot11/$pmang/memory/p5.md
set -g __fish_agent_vault_autopush 1 set -g __fish_agent_vault_autopush 1
set -l fp2err (mktemp); set -ga TMPDIRS $fp2err set -l fp2err (mktemp)
set -ga TMPDIRS $fp2err
pushd $pp >/dev/null pushd $pp >/dev/null
set -l fp2rc (agents-vault --quiet 2>$fp2err >/dev/null; echo $status) set -l fp2rc (agents-vault --quiet 2>$fp2err >/dev/null; echo $status)
popd >/dev/null popd >/dev/null
@@ -1561,10 +1618,14 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (the user's ssh command wins) ==" echo "== agents-vault (the user's ssh command wins) =="
set -l vroot14 (mktemp -d); set -ga TMPDIRS $vroot14 set -l vroot14 (mktemp -d)
set -l croot14 (mktemp -d); set -ga TMPDIRS $croot14 set -ga TMPDIRS $vroot14
set -l chome14 (mktemp -d); set -ga TMPDIRS $chome14 set -l croot14 (mktemp -d)
set -l agy14 (mktemp -d); set -ga TMPDIRS $agy14 set -ga TMPDIRS $croot14
set -l chome14 (mktemp -d)
set -ga TMPDIRS $chome14
set -l agy14 (mktemp -d)
set -ga TMPDIRS $agy14
set -g __fish_agent_vault_dir $vroot14/agent-vault set -g __fish_agent_vault_dir $vroot14/agent-vault
set -g __fish_agent_vault_claude_root $croot14 set -g __fish_agent_vault_claude_root $croot14
set -g __fish_agent_vault_claude_home $chome14 set -g __fish_agent_vault_claude_home $chome14
@@ -1574,7 +1635,8 @@ set -g __fish_agent_vault_agy_root $agy14
# plain `ssh` (what the injected default resolves to) and one named # plain `ssh` (what the injected default resolves to) and one named
# explicitly by the user. Both refuse the connection, so nothing leaves # explicitly by the user. Both refuse the connection, so nothing leaves
# the machine and no test waits on a network. # the machine and no test waits on a network.
set -l sbin (mktemp -d); set -ga TMPDIRS $sbin set -l sbin (mktemp -d)
set -ga TMPDIRS $sbin
set -l pathssh_log $sbin/path-ssh.log set -l pathssh_log $sbin/path-ssh.log
set -l usessh $sbin/user-ssh set -l usessh $sbin/user-ssh
set -l usessh_log $sbin/user-ssh.log set -l usessh_log $sbin/user-ssh.log
@@ -1655,11 +1717,16 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (autopush without timeout) ==" echo "== agents-vault (autopush without timeout) =="
set -l vroot15 (mktemp -d); set -ga TMPDIRS $vroot15 set -l vroot15 (mktemp -d)
set -l croot15 (mktemp -d); set -ga TMPDIRS $croot15 set -ga TMPDIRS $vroot15
set -l chome15 (mktemp -d); set -ga TMPDIRS $chome15 set -l croot15 (mktemp -d)
set -l agy15 (mktemp -d); set -ga TMPDIRS $agy15 set -ga TMPDIRS $croot15
set -l bare15 (mktemp -d); set -ga TMPDIRS $bare15 set -l chome15 (mktemp -d)
set -ga TMPDIRS $chome15
set -l agy15 (mktemp -d)
set -ga TMPDIRS $agy15
set -l bare15 (mktemp -d)
set -ga TMPDIRS $bare15
git init -q --bare $bare15 git init -q --bare $bare15
set -g __fish_agent_vault_dir $vroot15/agent-vault set -g __fish_agent_vault_dir $vroot15/agent-vault
set -g __fish_agent_vault_claude_root $croot15 set -g __fish_agent_vault_claude_root $croot15
@@ -1678,7 +1745,8 @@ popd >/dev/null
# rev-parse would report the literal string HEAD with a fatal on stderr. # rev-parse would report the literal string HEAD with a fatal on stderr.
set -l vb15 (git -C $vroot15/agent-vault symbolic-ref --short HEAD) set -l vb15 (git -C $vroot15/agent-vault symbolic-ref --short HEAD)
set -l shimroot (mktemp -d); set -ga TMPDIRS $shimroot set -l shimroot (mktemp -d)
set -ga TMPDIRS $shimroot
set -l nopath set -l nopath
set -l shimn 0 set -l shimn 0
for d in $PATH for d in $PATH
@@ -1696,7 +1764,8 @@ end
set -l realpath15 $PATH set -l realpath15 $PATH
echo t2 >$croot15/$tmang15/memory/t2.md echo t2 >$croot15/$tmang15/memory/t2.md
set -l terr (mktemp); set -ga TMPDIRS $terr set -l terr (mktemp)
set -ga TMPDIRS $terr
set -g __fish_agent_vault_autopush 1 set -g __fish_agent_vault_autopush 1
set -g PATH $nopath set -g PATH $nopath
check "the shimmed PATH really has no timeout" false (type -q timeout; and echo true; or echo false) check "the shimmed PATH really has no timeout" false (type -q timeout; and echo true; or echo false)
@@ -1737,10 +1806,14 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (a failed vault commit is fatal) ==" echo "== agents-vault (a failed vault commit is fatal) =="
set -l vroot13 (mktemp -d); set -ga TMPDIRS $vroot13 set -l vroot13 (mktemp -d)
set -l croot13 (mktemp -d); set -ga TMPDIRS $croot13 set -ga TMPDIRS $vroot13
set -l chome13 (mktemp -d); set -ga TMPDIRS $chome13 set -l croot13 (mktemp -d)
set -l agy13 (mktemp -d); set -ga TMPDIRS $agy13 set -ga TMPDIRS $croot13
set -l chome13 (mktemp -d)
set -ga TMPDIRS $chome13
set -l agy13 (mktemp -d)
set -ga TMPDIRS $agy13
set -g __fish_agent_vault_dir $vroot13/agent-vault set -g __fish_agent_vault_dir $vroot13/agent-vault
set -g __fish_agent_vault_claude_root $croot13 set -g __fish_agent_vault_claude_root $croot13
set -g __fish_agent_vault_claude_home $chome13 set -g __fish_agent_vault_claude_home $chome13
@@ -1763,7 +1836,8 @@ printf '#!/bin/sh\nexit 1\n' >$vroot13/agent-vault/.agents-tools/hooks/pre-commi
chmod +x $vroot13/agent-vault/.agents-tools/hooks/pre-commit chmod +x $vroot13/agent-vault/.agents-tools/hooks/pre-commit
echo hook-more >$croot13/$hmang13/memory/keep2.md echo hook-more >$croot13/$hmang13/memory/keep2.md
set -l hhead13 (git -C $vroot13/agent-vault rev-list --count HEAD) set -l hhead13 (git -C $vroot13/agent-vault rev-list --count HEAD)
set -l herr13 (mktemp); set -ga TMPDIRS $herr13 set -l herr13 (mktemp)
set -ga TMPDIRS $herr13
pushd $hp13 >/dev/null pushd $hp13 >/dev/null
set -l hrc13 (agents-vault --silent 2>$herr13; echo $status) set -l hrc13 (agents-vault --silent 2>$herr13; echo $status)
popd >/dev/null popd >/dev/null
@@ -1782,16 +1856,21 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
# moves ahead (or goes out of reach) is not a backup; --push is where the # moves ahead (or goes out of reach) is not a backup; --push is where the
# divergence has to be reckoned with, and where the two ways it can fail # divergence has to be reckoned with, and where the two ways it can fail
# have to be told apart. # have to be told apart.
set -l vroot14 (mktemp -d); set -ga TMPDIRS $vroot14 set -l vroot14 (mktemp -d)
set -l croot14 (mktemp -d); set -ga TMPDIRS $croot14 set -ga TMPDIRS $vroot14
set -l chome14 (mktemp -d); set -ga TMPDIRS $chome14 set -l croot14 (mktemp -d)
set -l agy14 (mktemp -d); set -ga TMPDIRS $agy14 set -ga TMPDIRS $croot14
set -l chome14 (mktemp -d)
set -ga TMPDIRS $chome14
set -l agy14 (mktemp -d)
set -ga TMPDIRS $agy14
set -g __fish_agent_vault_dir $vroot14/agent-vault set -g __fish_agent_vault_dir $vroot14/agent-vault
set -g __fish_agent_vault_claude_root $croot14 set -g __fish_agent_vault_claude_root $croot14
set -g __fish_agent_vault_claude_home $chome14 set -g __fish_agent_vault_claude_home $chome14
set -g __fish_agent_vault_agy_root $agy14 set -g __fish_agent_vault_agy_root $agy14
set -l bare14 (mktemp -d); set -ga TMPDIRS $bare14 set -l bare14 (mktemp -d)
set -ga TMPDIRS $bare14
git init -q --bare $bare14 git init -q --bare $bare14
set -l cp14 (new_repo https://git.rootiest.dev/rootiest/conflict.git) set -l cp14 (new_repo https://git.rootiest.dev/rootiest/conflict.git)
@@ -1806,7 +1885,8 @@ agents-vault --remote=$bare14 --silent
git -C $vroot14/agent-vault push -q -u origin HEAD:refs/heads/main git -C $vroot14/agent-vault push -q -u origin HEAD:refs/heads/main
# Another machine records a conflicting change to the same line... # Another machine records a conflicting change to the same line...
set -l cclone14 (mktemp -d); set -ga TMPDIRS $cclone14 set -l cclone14 (mktemp -d)
set -ga TMPDIRS $cclone14
git clone -q $bare14 $cclone14 git clone -q $bare14 $cclone14
git -C $cclone14 config user.email t@t git -C $cclone14 config user.email t@t
git -C $cclone14 config user.name t git -C $cclone14 config user.name t
@@ -1819,7 +1899,8 @@ git -C $cclone14 push -q origin HEAD:main
# ... while this one writes conflicting memory of its own on the same # ... while this one writes conflicting memory of its own on the same
# line. The ordinary run has to commit it: it never fetches, so the # line. The ordinary run has to commit it: it never fetches, so the
# divergence is invisible to it and irrelevant. # divergence is invisible to it and irrelevant.
set -l cerr14 (mktemp); set -ga TMPDIRS $cerr14 set -l cerr14 (mktemp)
set -ga TMPDIRS $cerr14
echo ours >$croot14/$cmang14/memory/keep.md echo ours >$croot14/$cmang14/memory/keep.md
set -l chead14 (git -C $vroot14/agent-vault rev-list --count HEAD) set -l chead14 (git -C $vroot14/agent-vault rev-list --count HEAD)
pushd $cp14 >/dev/null pushd $cp14 >/dev/null
@@ -1885,10 +1966,14 @@ set -g __fish_agent_vault_agy_root $HERMETIC_HOME/agy
echo "" echo ""
echo "== agents-vault (dangling global memory link) ==" echo "== agents-vault (dangling global memory link) =="
set -l vroot12 (mktemp -d); set -ga TMPDIRS $vroot12 set -l vroot12 (mktemp -d)
set -l croot12 (mktemp -d); set -ga TMPDIRS $croot12 set -ga TMPDIRS $vroot12
set -l chome12 (mktemp -d); set -ga TMPDIRS $chome12 set -l croot12 (mktemp -d)
set -l agy12 (mktemp -d); set -ga TMPDIRS $agy12 set -ga TMPDIRS $croot12
set -l chome12 (mktemp -d)
set -ga TMPDIRS $chome12
set -l agy12 (mktemp -d)
set -ga TMPDIRS $agy12
set -g __fish_agent_vault_dir $vroot12/agent-vault set -g __fish_agent_vault_dir $vroot12/agent-vault
set -g __fish_agent_vault_claude_root $croot12 set -g __fish_agent_vault_claude_root $croot12
set -g __fish_agent_vault_claude_home $chome12 set -g __fish_agent_vault_claude_home $chome12
@@ -1900,7 +1985,8 @@ check "dangling: -L is the only signal" true (test -L $chome12/memory; and echo
check "dangling: the vault side is empty" false (test -e $vroot12/agent-vault/global/claude/memory; and echo true; or echo false) check "dangling: the vault side is empty" false (test -e $vroot12/agent-vault/global/claude/memory; and echo true; or echo false)
set -l dp (new_repo https://git.rootiest.dev/rootiest/dangling.git) set -l dp (new_repo https://git.rootiest.dev/rootiest/dangling.git)
set -l derr (mktemp); set -ga TMPDIRS $derr set -l derr (mktemp)
set -ga TMPDIRS $derr
pushd $dp >/dev/null pushd $dp >/dev/null
set -l drc (agents-vault --silent 2>$derr; echo $status) set -l drc (agents-vault --silent 2>$derr; echo $status)
popd >/dev/null popd >/dev/null
@@ -1934,7 +2020,8 @@ check "agents-init: committed the AGENTS repo" true (test (git -C $ip/AGENTS rev
# Offline. The pull that used to run here blocked the launch until the # Offline. The pull that used to run here blocked the launch until the
# remote timed out and then took the commit down with it, so an agent's # remote timed out and then took the commit down with it, so an agent's
# edits went unrecorded on every launch away from the network. # edits went unrecorded on every launch away from the network.
set -l ibare (mktemp -d); set -ga TMPDIRS $ibare set -l ibare (mktemp -d)
set -ga TMPDIRS $ibare
git init -q --bare $ibare git init -q --bare $ibare
git -C $ip/AGENTS remote add origin $ibare git -C $ip/AGENTS remote add origin $ibare
git -C $ip/AGENTS push -q -u origin HEAD 2>/dev/null git -C $ip/AGENTS push -q -u origin HEAD 2>/dev/null
@@ -1957,7 +2044,8 @@ printf '#!/bin/sh\nexit 1\n' >$ip/AGENTS/.agents-tools/hooks/pre-commit
chmod +x $ip/AGENTS/.agents-tools/hooks/pre-commit chmod +x $ip/AGENTS/.agents-tools/hooks/pre-commit
echo blocked >$ip/AGENTS/devlogs/blocked.md echo blocked >$ip/AGENTS/devlogs/blocked.md
set -l ibhead (git -C $ip/AGENTS rev-list --count HEAD) set -l ibhead (git -C $ip/AGENTS rev-list --count HEAD)
set -l ierr (mktemp); set -ga TMPDIRS $ierr set -l ierr (mktemp)
set -ga TMPDIRS $ierr
pushd $ip >/dev/null pushd $ip >/dev/null
set -l ibrc (agents-init --silent 2>$ierr; echo $status) set -l ibrc (agents-init --silent 2>$ierr; echo $status)
popd >/dev/null popd >/dev/null
+4 -4
View File
@@ -245,10 +245,10 @@ section "op_enabled: always/* and AND, via a synthetic registry"
# this process reads them, so overriding them is free. # this process reads them, so overriding them is free.
set -g __fish_config_op_registry_keys "syn_on:" "syn_off:" "syn_and:" "syn_bare:" "syn_multi:" set -g __fish_config_op_registry_keys "syn_on:" "syn_off:" "syn_and:" "syn_bare:" "syn_multi:"
set -g __fish_config_op_registry_values \ set -g __fish_config_op_registry_values \
"always/on" \ always/on \
"always/off" \ always/off \
"aliases/filesystem integrations/notifications" \ "aliases/filesystem integrations/notifications" \
"aliases" \ aliases \
"always/off always/on" "always/off always/on"
set -e __fish_config_op_aliases __fish_config_op_integrations __fish_config_opinionated set -e __fish_config_op_aliases __fish_config_op_integrations __fish_config_opinionated
@@ -312,7 +312,7 @@ section "op_enabled: C5 through the guard"
# The path production code actually takes, as opposed to calling the cascade # The path production code actually takes, as opposed to calling the cascade
# directly. Same rule: unset means off and the master cannot enable it. # directly. Same rule: unset means off and the master cannot enable it.
set -g __fish_config_op_registry_keys "syn_log:" set -g __fish_config_op_registry_keys "syn_log:"
set -g __fish_config_op_registry_values "logging/terminal-capture" set -g __fish_config_op_registry_values logging/terminal-capture
set -e __fish_config_op_logging __fish_config_op_logging_terminal_capture set -e __fish_config_op_logging __fish_config_op_logging_terminal_capture
__fish_config_op_enabled syn_log __fish_config_op_enabled syn_log
+3 -3
View File
@@ -45,7 +45,7 @@ function test_help_renderer
'function fixturefn' \ 'function fixturefn' \
' __fish_help_header (status current-function) $argv; and return 0' \ ' __fish_help_header (status current-function) $argv; and return 0' \
' echo RAN-BODY' \ ' echo RAN-BODY' \
'end' >$tmp/fixturefn.fish end >$tmp/fixturefn.fish
set -l out (_help_probe $tmp 'fixturefn --help') set -l out (_help_probe $tmp 'fixturefn --help')
set -l code $status set -l code $status
@@ -106,14 +106,14 @@ function test_help_renderer_degrades_safely
'function headerless' \ 'function headerless' \
' __fish_help_header (status current-function) $argv; and return 0' \ ' __fish_help_header (status current-function) $argv; and return 0' \
" touch $tmp/BODY-RAN" \ " touch $tmp/BODY-RAN" \
'end' >$tmp/headerless.fish end >$tmp/headerless.fish
# A comment run carrying no `# LABEL` line at all. # A comment run carrying no `# LABEL` line at all.
printf '%s\n' \ printf '%s\n' \
'# just an ordinary comment, no labels here' \ '# just an ordinary comment, no labels here' \
'function malformed' \ 'function malformed' \
' __fish_help_header (status current-function) $argv; and return 0' \ ' __fish_help_header (status current-function) $argv; and return 0' \
" touch $tmp/BODY-RAN" \ " touch $tmp/BODY-RAN" \
'end' >$tmp/malformed.fish end >$tmp/malformed.fish
set -l failed 0 set -l failed 0
for fn in headerless malformed for fn in headerless malformed
+38 -49
View File
@@ -57,22 +57,22 @@ printf '%s\n' \
'#!/bin/sh' \ '#!/bin/sh' \
'if [ -n "$MOCK_CURL_LOG" ]; then' \ 'if [ -n "$MOCK_CURL_LOG" ]; then' \
' printf "%s\n" "$*" >> "$MOCK_CURL_LOG"' \ ' printf "%s\n" "$*" >> "$MOCK_CURL_LOG"' \
'fi' \ fi \
'if [ -n "$MOCK_CURL_HANDLER" ] && [ -x "$MOCK_CURL_HANDLER" ]; then' \ 'if [ -n "$MOCK_CURL_HANDLER" ] && [ -x "$MOCK_CURL_HANDLER" ]; then' \
' exec "$MOCK_CURL_HANDLER" "$@"' \ ' exec "$MOCK_CURL_HANDLER" "$@"' \
'fi' \ fi \
'if [ -n "$MOCK_CURL_DELAY" ]; then' \ 'if [ -n "$MOCK_CURL_DELAY" ]; then' \
' sleep "$MOCK_CURL_DELAY"' \ ' sleep "$MOCK_CURL_DELAY"' \
'fi' \ fi \
'if [ -n "$MOCK_CURL_STDERR" ]; then' \ 'if [ -n "$MOCK_CURL_STDERR" ]; then' \
' printf "%s\n" "$MOCK_CURL_STDERR" >&2' \ ' printf "%s\n" "$MOCK_CURL_STDERR" >&2' \
'fi' \ fi \
'if [ -f "$MOCK_CURL_BODY_FILE" ]; then' \ 'if [ -f "$MOCK_CURL_BODY_FILE" ]; then' \
' cat "$MOCK_CURL_BODY_FILE"' \ ' cat "$MOCK_CURL_BODY_FILE"' \
'elif [ -n "$MOCK_CURL_BODY" ]; then' \ 'elif [ -n "$MOCK_CURL_BODY" ]; then' \
' printf "%s\n" "$MOCK_CURL_BODY"' \ ' printf "%s\n" "$MOCK_CURL_BODY"' \
'fi' \ fi \
'exit "${MOCK_CURL_STATUS:-0}"' > $MOCK_DIR/curl 'exit "${MOCK_CURL_STATUS:-0}"' >$MOCK_DIR/curl
chmod +x $MOCK_DIR/curl chmod +x $MOCK_DIR/curl
# 2. Mock git shim # 2. Mock git shim
@@ -80,10 +80,10 @@ printf '%s\n' \
'#!/bin/sh' \ '#!/bin/sh' \
'if [ -n "$MOCK_GIT_LOG" ]; then' \ 'if [ -n "$MOCK_GIT_LOG" ]; then' \
' printf "%s\n" "$*" >> "$MOCK_GIT_LOG"' \ ' printf "%s\n" "$*" >> "$MOCK_GIT_LOG"' \
'fi' \ fi \
'if [ -n "$MOCK_GIT_HANDLER" ] && [ -x "$MOCK_GIT_HANDLER" ]; then' \ 'if [ -n "$MOCK_GIT_HANDLER" ] && [ -x "$MOCK_GIT_HANDLER" ]; then' \
' exec "$MOCK_GIT_HANDLER" "$@"' \ ' exec "$MOCK_GIT_HANDLER" "$@"' \
'fi' \ fi \
'for a in "$@"; do' \ 'for a in "$@"; do' \
' if [ "$a" = "fetch" ] && [ -n "$MOCK_GIT_FAIL_FETCH" ]; then' \ ' if [ "$a" = "fetch" ] && [ -n "$MOCK_GIT_FAIL_FETCH" ]; then' \
' echo "fatal: unable to access: Could not resolve host" >&2' \ ' echo "fatal: unable to access: Could not resolve host" >&2' \
@@ -101,8 +101,8 @@ printf '%s\n' \
' echo "fatal: unable to access: Could not resolve host" >&2' \ ' echo "fatal: unable to access: Could not resolve host" >&2' \
' exit "${MOCK_GIT_LS_REMOTE_STATUS:-128}"' \ ' exit "${MOCK_GIT_LS_REMOTE_STATUS:-128}"' \
' fi' \ ' fi' \
'done' \ done \
"exec $real_git \"\$@\"" > $MOCK_DIR/git "exec $real_git \"\$@\"" >$MOCK_DIR/git
chmod +x $MOCK_DIR/git chmod +x $MOCK_DIR/git
# 3. Mock bd CLI # 3. Mock bd CLI
@@ -114,8 +114,8 @@ printf '%s\n' \
' exit 0' \ ' exit 0' \
'elif [ "$1" = "sync" ]; then' \ 'elif [ "$1" = "sync" ]; then' \
' exit 0' \ ' exit 0' \
'fi' \ fi \
'exit 0' > $MOCK_DIR/bd 'exit 0' >$MOCK_DIR/bd
chmod +x $MOCK_DIR/bd chmod +x $MOCK_DIR/bd
# 4. Mock qrencode # 4. Mock qrencode
@@ -123,9 +123,9 @@ printf '%s\n' \
'#!/bin/sh' \ '#!/bin/sh' \
'if [ -n "$MOCK_QRENCODE_LOG" ]; then' \ 'if [ -n "$MOCK_QRENCODE_LOG" ]; then' \
' printf "%s\n" "$*" >> "$MOCK_QRENCODE_LOG"' \ ' printf "%s\n" "$*" >> "$MOCK_QRENCODE_LOG"' \
'fi' \ fi \
'echo "LOCAL_QRENCODE: $*"' \ 'echo "LOCAL_QRENCODE: $*"' \
'exit 0' > $MOCK_DIR/qrencode 'exit 0' >$MOCK_DIR/qrencode
chmod +x $MOCK_DIR/qrencode chmod +x $MOCK_DIR/qrencode
# Prepend MOCK_DIR to PATH so mocks take precedence # Prepend MOCK_DIR to PATH so mocks take precedence
@@ -158,7 +158,6 @@ function cleanup
end end
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 1. gi (gitignore generator) # 1. gi (gitignore generator)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -227,7 +226,6 @@ begin
builtin cd $prev_pwd builtin cd $prev_pwd
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 2. gip, gip4, gip6 (IP resolution) # 2. gip, gip4, gip6 (IP resolution)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -248,8 +246,8 @@ printf '%s\n' \
' echo "2001:db8::1"' \ ' echo "2001:db8::1"' \
' exit 0' \ ' exit 0' \
' fi' \ ' fi' \
'done' \ done \
'exit 0' > $gip_handler 'exit 0' >$gip_handler
chmod +x $gip_handler chmod +x $gip_handler
reset_mocks reset_mocks
@@ -304,7 +302,6 @@ set -l out_gip6_err (gip6 2>&1)
check "gip6: failure exits 1" 1 $status check "gip6: failure exits 1" 1 $status
check "gip6: failure prints notice" true (string match -q '*IPv6 is currently unavailable*' -- $out_gip6_err; and echo true; or echo false) check "gip6: failure prints notice" true (string match -q '*IPv6 is currently unavailable*' -- $out_gip6_err; and echo true; or echo false)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 3. qr (QR code generator) # 3. qr (QR code generator)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -320,31 +317,30 @@ check "qr: curl is never called when qrencode exists" 0 (test -f $MOCK_DIR/curl_
# Case B: Local qrencode is missing, falling back to curl # Case B: Local qrencode is missing, falling back to curl
function type function type
if test "$argv[1]" = "-q" -a "$argv[2]" = "qrencode" if test "$argv[1]" = -q -a "$argv[2]" = qrencode
return 1 return 1
end end
builtin type $argv builtin type $argv
end end
set -gx MOCK_CURL_BODY "UTF8_QR_BODY" set -gx MOCK_CURL_BODY UTF8_QR_BODY
set -l qr_curl (qr "hello-curl") set -l qr_curl (qr "hello-curl")
check "qr: fallback to curl when qrencode is missing" "UTF8_QR_BODY" "$qr_curl" check "qr: fallback to curl when qrencode is missing" UTF8_QR_BODY "$qr_curl"
# Network drop during curl fallback # Network drop during curl fallback
set -gx MOCK_CURL_STATUS 7 set -gx MOCK_CURL_STATUS 7
set -gx MOCK_CURL_BODY "" set -gx MOCK_CURL_BODY ""
qr "fail" >/dev/null 2>&1 qr fail >/dev/null 2>&1
check "qr: curl network drop returns non-zero" 7 $status check "qr: curl network drop returns non-zero" 7 $status
# Argument-based curl fallback # Argument-based curl fallback
set -gx MOCK_CURL_STATUS 0 set -gx MOCK_CURL_STATUS 0
set -gx MOCK_CURL_BODY "TEXT_QR" set -gx MOCK_CURL_BODY TEXT_QR
set -l qr_arg (qr "arg-text") set -l qr_arg (qr "arg-text")
check "qr: argument works via curl fallback" "TEXT_QR" "$qr_arg" check "qr: argument works via curl fallback" TEXT_QR "$qr_arg"
functions -e type functions -e type
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 4. bd-pull (Gitea issues sync) # 4. bd-pull (Gitea issues sync)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -361,13 +357,13 @@ begin
bd-pull rootiest/test >/dev/null 2>&1 bd-pull rootiest/test >/dev/null 2>&1
check "bd-pull: missing GITEA_TOKEN exits 1" 1 $status check "bd-pull: missing GITEA_TOKEN exits 1" 1 $status
set -gx GITEA_TOKEN "test_token" set -gx GITEA_TOKEN test_token
bd-pull rootiest/test >/dev/null 2>&1 bd-pull rootiest/test >/dev/null 2>&1
check "bd-pull: missing GITEA_URL exits 1" 1 $status check "bd-pull: missing GITEA_URL exits 1" 1 $status
end end
# Complete network drop / empty response # Complete network drop / empty response
set -gx GITEA_TOKEN "dummy_token" set -gx GITEA_TOKEN dummy_token
set -gx GITEA_URL "https://git.test" set -gx GITEA_URL "https://git.test"
set -gx MOCK_CURL_STATUS 7 set -gx MOCK_CURL_STATUS 7
set -gx MOCK_CURL_BODY "" set -gx MOCK_CURL_BODY ""
@@ -409,7 +405,6 @@ begin
builtin cd $prev_pwd builtin cd $prev_pwd
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 5. _auto_pull_sync (background fast-forward) # 5. _auto_pull_sync (background fast-forward)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -422,9 +417,9 @@ check "_auto_pull_sync: non-git directory returns 1" 1 $status
# Git repo without upstream branch # Git repo without upstream branch
set -l sync_repo (new_repo) set -l sync_repo (new_repo)
echo "test" > $sync_repo/file.txt echo test >$sync_repo/file.txt
git -C $sync_repo add file.txt git -C $sync_repo add file.txt
git -C $sync_repo commit -q -m "initial" git -C $sync_repo commit -q -m initial
_auto_pull_sync $sync_repo >/dev/null 2>&1 _auto_pull_sync $sync_repo >/dev/null 2>&1
check "_auto_pull_sync: missing upstream returns 1" 1 $status check "_auto_pull_sync: missing upstream returns 1" 1 $status
@@ -435,13 +430,13 @@ git -C $sync_repo remote add origin $sync_upstream
git -C $sync_repo push -q -u origin main >/dev/null 2>&1 git -C $sync_repo push -q -u origin main >/dev/null 2>&1
# Dirty working tree (unstaged modifications) # Dirty working tree (unstaged modifications)
echo "dirty" >> $sync_repo/file.txt echo dirty >>$sync_repo/file.txt
_auto_pull_sync $sync_repo >/dev/null 2>&1 _auto_pull_sync $sync_repo >/dev/null 2>&1
check "_auto_pull_sync: dirty worktree returns 1" 1 $status check "_auto_pull_sync: dirty worktree returns 1" 1 $status
git -C $sync_repo checkout -q -- file.txt git -C $sync_repo checkout -q -- file.txt
# Dirty index (staged modifications) # Dirty index (staged modifications)
echo "staged" >> $sync_repo/staged.txt echo staged >>$sync_repo/staged.txt
git -C $sync_repo add staged.txt git -C $sync_repo add staged.txt
_auto_pull_sync $sync_repo >/dev/null 2>&1 _auto_pull_sync $sync_repo >/dev/null 2>&1
check "_auto_pull_sync: dirty index returns 1" 1 $status check "_auto_pull_sync: dirty index returns 1" 1 $status
@@ -458,7 +453,7 @@ reset_mocks
# Add commit to upstream # Add commit to upstream
set -l peer_clone (new_repo) set -l peer_clone (new_repo)
git -C $peer_clone clone -q $sync_upstream $peer_clone/work git -C $peer_clone clone -q $sync_upstream $peer_clone/work
echo "new commit" > $peer_clone/work/new.txt echo "new commit" >$peer_clone/work/new.txt
git -C $peer_clone/work add new.txt git -C $peer_clone/work add new.txt
git -C $peer_clone/work commit -q -m "upstream work" git -C $peer_clone/work commit -q -m "upstream work"
git -C $peer_clone/work push -q origin main git -C $peer_clone/work push -q origin main
@@ -467,7 +462,6 @@ _auto_pull_sync $sync_repo >/dev/null 2>&1
check "_auto_pull_sync: clean fast-forward returns 0" 0 $status check "_auto_pull_sync: clean fast-forward returns 0" 0 $status
check "_auto_pull_sync: changes merged into working tree" true (test -f $sync_repo/new.txt; and echo true; or echo false) check "_auto_pull_sync: changes merged into working tree" true (test -f $sync_repo/new.txt; and echo true; or echo false)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 6. gitup (fetch and status) # 6. gitup (fetch and status)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -482,7 +476,7 @@ begin
set -l r (new_repo) set -l r (new_repo)
builtin cd $r builtin cd $r
echo a > a && git add a && git commit -q -m a echo a >a && git add a && git commit -q -m a
# Network failure on git fetch # Network failure on git fetch
set -gx MOCK_GIT_FAIL_FETCH 1 set -gx MOCK_GIT_FAIL_FETCH 1
@@ -497,7 +491,6 @@ begin
builtin cd $prev_pwd builtin cd $prev_pwd
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 7. git-clean (fetch --prune and delete orphaned branches) # 7. git-clean (fetch --prune and delete orphaned branches)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -511,7 +504,7 @@ begin
set -l prev_pwd $PWD set -l prev_pwd $PWD
set -l r (new_repo) set -l r (new_repo)
builtin cd $r builtin cd $r
echo a > a && git add a && git commit -q -m a echo a >a && git add a && git commit -q -m a
# Network drop during git fetch --prune # Network drop during git fetch --prune
set -gx MOCK_GIT_FAIL_FETCH 1 set -gx MOCK_GIT_FAIL_FETCH 1
@@ -533,8 +526,8 @@ begin
' echo " orphaned-feat abcdef0 [origin/orphaned-feat: gone] feature"' \ ' echo " orphaned-feat abcdef0 [origin/orphaned-feat: gone] feature"' \
' exit 0' \ ' exit 0' \
' fi' \ ' fi' \
'done' \ done \
"exec $real_git \"\$@\"" > $clean_git_handler "exec $real_git \"\$@\"" >$clean_git_handler
chmod +x $clean_git_handler chmod +x $clean_git_handler
set -gx MOCK_GIT_HANDLER $clean_git_handler set -gx MOCK_GIT_HANDLER $clean_git_handler
@@ -545,7 +538,6 @@ begin
builtin cd $prev_pwd builtin cd $prev_pwd
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 8. config-update (configuration repository sync) # 8. config-update (configuration repository sync)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -563,8 +555,8 @@ printf '%s\n' \
' if [ "$a" = "fetch" ] && [ -n "$MOCK_CFG_FAIL_FETCH" ]; then' \ ' if [ "$a" = "fetch" ] && [ -n "$MOCK_CFG_FAIL_FETCH" ]; then' \
' exit 1' \ ' exit 1' \
' fi' \ ' fi' \
'done' \ done \
"exec $real_git \"\$@\"" > $cfg_update_handler "exec $real_git \"\$@\"" >$cfg_update_handler
chmod +x $cfg_update_handler chmod +x $cfg_update_handler
set -gx MOCK_GIT_HANDLER $cfg_update_handler set -gx MOCK_GIT_HANDLER $cfg_update_handler
@@ -584,7 +576,6 @@ begin
check "config-update: network fetch failure returns 1" 1 $status check "config-update: network fetch failure returns 1" 1 $status
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 9. repo-open (origin URL normalization and browser deep-linking) # 9. repo-open (origin URL normalization and browser deep-linking)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -616,7 +607,7 @@ end
# In git repo with GitHub origin remote # In git repo with GitHub origin remote
set -l r_gh (new_repo) set -l r_gh (new_repo)
git -C $r_gh remote add origin "https://github.com/rootiest/fish-config.git" git -C $r_gh remote add origin "https://github.com/rootiest/fish-config.git"
echo init > $r_gh/file && git -C $r_gh add file && git -C $r_gh commit -q -m init echo init >$r_gh/file && git -C $r_gh add file && git -C $r_gh commit -q -m init
begin begin
set -l prev_pwd $PWD set -l prev_pwd $PWD
builtin cd $r_gh builtin cd $r_gh
@@ -636,8 +627,8 @@ begin
' echo "abcdef01 refs/heads/main"' \ ' echo "abcdef01 refs/heads/main"' \
' exit 0' \ ' exit 0' \
' fi' \ ' fi' \
'done' \ done \
"exec $real_git \"\$@\"" > $gh_ls_handler "exec $real_git \"\$@\"" >$gh_ls_handler
chmod +x $gh_ls_handler chmod +x $gh_ls_handler
set -gx MOCK_GIT_HANDLER $gh_ls_handler set -gx MOCK_GIT_HANDLER $gh_ls_handler
@@ -656,7 +647,6 @@ begin
builtin cd $prev_pwd builtin cd $prev_pwd
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# 10. fzf-update (fzf install / git pull) # 10. fzf-update (fzf install / git pull)
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
@@ -686,7 +676,6 @@ begin
check "fzf-update: git clone network drop returns non-zero" true (test $status -ne 0; and echo true; or echo false) check "fzf-update: git clone network drop returns non-zero" true (test $status -ne 0; and echo true; or echo false)
end end
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────
# Teardown and Final Report # Teardown and Final Report
# ───────────────────────────────────────────────────────────────────────────── # ─────────────────────────────────────────────────────────────────────────────