# Upstream Module - Repository Tracking and Synchronization # Commands for managing upstream repositories and automated tracking # ๐Ÿ” UPSTREAM CHECK COMMANDS # Check upstream changes for all plugins [no-cd] upstream-check: @echo "๐Ÿ” Checking upstream changes..." @{{justfile_directory()}}/scripts/run.sh check_upstream_changes.nu # Check upstream for specific plugin [no-cd] upstream-check-plugin PLUGIN: @echo "๐Ÿ” Checking upstream for {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh check_upstream_changes.nu --plugin {{PLUGIN}} # Check upstream with verbose output [no-cd] upstream-check-verbose: @echo "๐Ÿ” Checking upstream changes (verbose)..." @{{justfile_directory()}}/scripts/run.sh check_upstream_changes.nu --verbose # Check only plugins with pending status [no-cd] upstream-check-pending: @echo "๐Ÿ” Checking only pending plugins..." @{{justfile_directory()}}/scripts/run.sh check_upstream_changes.nu --pending-only # ๐Ÿ‘€ UPSTREAM PREVIEW COMMANDS # Preview merge changes for a plugin [no-cd] upstream-preview PLUGIN: @echo "๐Ÿ‘€ Preview merge for {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --preview {{PLUGIN}} # Preview all pending merges [no-cd] upstream-preview-all: @echo "๐Ÿ‘€ Preview all pending merges..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --preview --all # Show diff for plugin [no-cd] upstream-diff PLUGIN: @echo "๐Ÿ“‹ Showing diff for {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --diff {{PLUGIN}} # ๐Ÿ”€ UPSTREAM MERGE COMMANDS # Safely merge upstream changes for a plugin [no-cd] upstream-merge PLUGIN: @echo "๐Ÿ”€ Merging upstream changes for {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu {{PLUGIN}} # Merge all pending upstream changes [no-cd] upstream-merge-all: @echo "๐Ÿ”€ Merging all pending upstream changes..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --all # Force merge upstream for a plugin (even if status is OK) [no-cd] upstream-merge-force PLUGIN: @echo "๐Ÿ’ช Force merging {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --force {{PLUGIN}} # Merge with auto-approval of dependency-only changes [no-cd] upstream-merge-auto PLUGIN: @echo "๐Ÿค– Auto-merging {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --auto-approve {{PLUGIN}} # Merge all with auto-approval [no-cd] upstream-merge-auto-all: @echo "๐Ÿค– Auto-merging all pending changes..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --auto-approve --all # ๐Ÿ”™ UPSTREAM ROLLBACK COMMANDS # Rollback last merge for plugin [no-cd] upstream-rollback PLUGIN: @echo "๐Ÿ”™ Rolling back {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --rollback {{PLUGIN}} # Show rollback options for plugin [no-cd] upstream-rollback-info PLUGIN: @echo "โ„น๏ธ Rollback info for {{PLUGIN}}..." @{{justfile_directory()}}/scripts/run.sh safe_merge_upstream.nu --rollback-info {{PLUGIN}} # ๐Ÿ“Š UPSTREAM STATUS COMMANDS # Show upstream status for all plugins [no-cd] upstream-status: @echo "๐Ÿ“Š Upstream Status" @{{justfile_directory()}}/scripts/run.sh plugin_status.nu # Show detailed upstream status [no-cd] upstream-status-detailed: @echo "๐Ÿ“Š Detailed Upstream Status" @{{justfile_directory()}}/scripts/run.sh plugin_status.nu --all # Show plugins requiring attention [no-cd] upstream-attention: @echo "๐Ÿšจ Plugins Requiring Attention" @{{justfile_directory()}}/scripts/run.sh plugin_status.nu attention # Show upstream summary [no-cd] upstream-summary: @echo "๐Ÿ“Š Upstream Summary" @{{justfile_directory()}}/scripts/run.sh plugin_status.nu summary # Update plugin status manually upstream-status-update PLUGIN STATUS: @echo "๐Ÿ”„ Updating {{PLUGIN}} status to {{STATUS}}..." @{{justfile_directory()}}/scripts/run.sh plugin_status.nu update {{PLUGIN}} {{STATUS}} # Mark local development plugins as OK [no-cd] upstream-mark-locals-ok: @echo "โœ… Marking local development plugins as OK..." @{{justfile_directory()}}/scripts/run.sh plugin_status.nu update nu_plugin_image ok @{{justfile_directory()}}/scripts/run.sh plugin_status.nu update nu_plugin_hashes ok @{{justfile_directory()}}/scripts/run.sh plugin_status.nu update nu_plugin_desktop_notifications ok @echo "โœ… All local plugins marked as OK" # ๐Ÿ”ง UPSTREAM CONFIGURATION # Show plugin registry information [no-cd] upstream-registry: @echo "๐Ÿ“‹ Plugin Registry Information:" @if [ -f etc/plugin_registry.toml ]; then \ echo "Registry file: etc/plugin_registry.toml"; \ echo ""; \ echo "Plugins with upstream:"; \ grep -A2 "upstream_url.*=" etc/plugin_registry.toml | grep -v "^--" || true; \ else \ echo "Registry file not found!"; \ fi # Add plugin to upstream exclusion list [no-cd] upstream-exclude PLUGIN: @echo "๐Ÿšซ Adding {{PLUGIN}} to exclusion list..." @EXCLUDE_FILE="etc/upstream_exclude.toml"; \ if grep -q "^plugins = \[" "$$EXCLUDE_FILE" 2>/dev/null; then \ sed -i.bak "/^plugins = \[/s/\]/\"{{PLUGIN}}\", \]/" "$$EXCLUDE_FILE"; \ echo "โœ… Added {{PLUGIN}} to exclusions"; \ else \ echo "โš ๏ธ Please manually add {{PLUGIN}} to $$EXCLUDE_FILE"; \ fi # Remove plugin from upstream exclusion list [no-cd] upstream-include PLUGIN: @echo "โœ… Removing {{PLUGIN}} from exclusion list..." @EXCLUDE_FILE="etc/upstream_exclude.toml"; \ sed -i.bak "s/\"{{PLUGIN}}\",*[[:space:]]*//" "$$EXCLUDE_FILE"; \ echo "โœ… Removed {{PLUGIN}} from exclusions" # Show excluded plugins [no-cd] upstream-excluded: @echo "๐Ÿ“‹ Currently excluded plugins:" @EXCLUDE_FILE="etc/upstream_exclude.toml"; \ if [ -f "$$EXCLUDE_FILE" ]; then \ grep -A10 "\[exclude\]" "$$EXCLUDE_FILE" | grep -E "^[[:space:]]*\"" | sed 's/[",]//g' | sed 's/^[[:space:]]*/ - /' || echo "No exclusions found"; \ else \ echo "No exclusions file found"; \ fi # ๐Ÿ”„ UPSTREAM MAINTENANCE # Fetch all upstream repositories [no-cd] upstream-fetch-all: @echo "๐Ÿ”„ Fetching all upstream repositories..." @for plugin in nu_plugin_*; do \ if [ -d "$$plugin/.git" ]; then \ echo "Fetching $$plugin..."; \ cd "$$plugin" && git fetch --all && cd ..; \ fi; \ done # Show outdated upstream references [no-cd] upstream-outdated: @echo "๐Ÿ“… Checking for outdated upstream references..." @{{justfile_directory()}}/scripts/run.sh check_upstream_changes.nu --show-outdated # Cleanup upstream tracking data [no-cd] upstream-cleanup: @echo "๐Ÿงน Cleaning up upstream tracking data..." @find . -name ".upstream_*" -type f -delete @echo "โœ… Cleanup completed" # ๐Ÿšจ UPSTREAM CONFLICT RESOLUTION # Show conflicts for plugin [no-cd] upstream-conflicts PLUGIN: @echo "๐Ÿšจ Showing conflicts for {{PLUGIN}}..." @cd {{PLUGIN}} && git status --porcelain | grep "^UU" || echo "No conflicts found" # Reset plugin to clean state [no-cd] upstream-reset PLUGIN: @echo "๐Ÿ”„ Resetting {{PLUGIN}} to clean state..." @cd {{PLUGIN}} && git reset --hard HEAD && git clean -fd # Create backup branch before merge [no-cd] upstream-backup PLUGIN: @echo "๐Ÿ’พ Creating backup branch for {{PLUGIN}}..." @cd {{PLUGIN}} && git branch "backup-$(date +%Y%m%d-%H%M%S)" && echo "โœ… Backup branch created" # ๐Ÿ“Š UPSTREAM INFORMATION # Show upstream help [no-cd] upstream-help: @echo "๐Ÿ”„ Upstream Module Help" @echo "======================" @echo "" @echo "CHECK COMMANDS:" @echo " upstream-check - Check all upstream changes" @echo " upstream-check-plugin PLUGIN - Check specific plugin" @echo " upstream-check-verbose - Check with verbose output" @echo " upstream-check-pending - Check only pending plugins" @echo "" @echo "PREVIEW COMMANDS:" @echo " upstream-preview PLUGIN - Preview merge changes" @echo " upstream-preview-all - Preview all pending merges" @echo " upstream-diff PLUGIN - Show diff for plugin" @echo "" @echo "MERGE COMMANDS:" @echo " upstream-merge PLUGIN - Merge upstream changes" @echo " upstream-merge-all - Merge all pending changes" @echo " upstream-merge-force PLUGIN - Force merge" @echo " upstream-merge-auto PLUGIN - Auto-merge dependencies" @echo " upstream-merge-auto-all - Auto-merge all dependencies" @echo "" @echo "ROLLBACK COMMANDS:" @echo " upstream-rollback PLUGIN - Rollback last merge" @echo " upstream-rollback-info PLUGIN - Show rollback info" @echo "" @echo "STATUS COMMANDS:" @echo " upstream-status - Show status for all plugins" @echo " upstream-status-detailed - Show detailed status" @echo " upstream-attention - Show plugins needing attention" @echo " upstream-summary - Show summary" @echo " upstream-status-update PLUGIN STATUS - Update status" @echo " upstream-mark-locals-ok - Mark local plugins as OK" @echo "" @echo "CONFIGURATION:" @echo " upstream-registry - Show registry information" @echo " upstream-exclude PLUGIN - Add to exclusion list" @echo " upstream-include PLUGIN - Remove from exclusion list" @echo " upstream-excluded - Show excluded plugins" @echo "" @echo "MAINTENANCE:" @echo " upstream-fetch-all - Fetch all repositories" @echo " upstream-outdated - Show outdated references" @echo " upstream-cleanup - Clean tracking data" @echo "" @echo "CONFLICT RESOLUTION:" @echo " upstream-conflicts PLUGIN - Show conflicts" @echo " upstream-reset PLUGIN - Reset to clean state" @echo " upstream-backup PLUGIN - Create backup branch" @echo "" @echo "EXAMPLES:" @echo " just upstream-check-plugin nu_plugin_clipboard" @echo " just upstream-preview nu_plugin_highlight" @echo " just upstream-merge-auto-all" @echo " just upstream-exclude nu_plugin_custom"