From 823ec3d499ae2fa9bb48ee8fffa5dfe010ece65f Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 7 Aug 2026 01:32:51 -0400 Subject: [PATCH] Add update_deps.ps1 (clone computer enhance repo) --- Readme.md | 6 +++++- code/duffle/dsl.h | 2 +- scripts/helpers/misc.ps1 | 13 +++++++++++-- scripts/update_deps.ps1 | 25 +++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index 99b45b1..ac2e022 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,10 @@ # Computer Enhance: Performance Aware Programming Course -``` +Progressing with company team. + +Disable latency of submodules: + +```ps1 git -C . config --local diff.ignoreSubmodules all git -C . config --local status.submoduleSummary false git -C . config --local submodule.recurse false diff --git a/code/duffle/dsl.h b/code/duffle/dsl.h index 1f7e091..d7445a8 100644 --- a/code/duffle/dsl.h +++ b/code/duffle/dsl.h @@ -27,7 +27,7 @@ Standard: c23 #define WinAPI __attribute((__stdcall__)) __attribute__((__force_align_arg_pointer__)) // Win32 Syscall FFI -#define os_layer // Marker for interfaced resolved by os platform layer. +#define os_layer // Marker for interface resolved by os platform layer. #pragma endregion Platform #define offset_of(type, member) cast(U8,__builtin_offsetof(type,member)) diff --git a/scripts/helpers/misc.ps1 b/scripts/helpers/misc.ps1 index 51fa476..318afe9 100644 --- a/scripts/helpers/misc.ps1 +++ b/scripts/helpers/misc.ps1 @@ -1,6 +1,15 @@ -function clone-gitrepo { param( [string] $path, [string] $url ) +function clone-gitrepo { param( [string] $path, [string] $url, [switch] $NoPull ) if (test-path $path) { - # git -C $path pull + if ($NoPull) { + Write-Host "Skipping pull on $path (per -NoPull)." + return + } + # Already a checkout — refresh to upstream tip. + # --ff-only refuses to create a merge commit if the local branch has + # diverged, so a divergence surfaces as a clear git error instead of a + # silent merge. Preserves the read-only intent of update_deps. + Write-Host "Pulling latest into $path ..." + git -C $path pull --ff-only } else { Write-Host "Cloning $url ..." diff --git a/scripts/update_deps.ps1 b/scripts/update_deps.ps1 index e69de29..92c3f98 100644 --- a/scripts/update_deps.ps1 +++ b/scripts/update_deps.ps1 @@ -0,0 +1,25 @@ +# ════════════════════════════════════════════════════════════════════════════ +# update_deps.ps1 — fetch / refresh. +# ════════════════════════════════════════════════════════════════════════════ +param( + [switch] $NoPull # Skip the `git pull` step when the checkout already exists. +) + +$path_root = split-path -Path $PSScriptRoot -Parent +$path_course_content = join-path $path_root 'course_content' +$misc = join-path $PSScriptRoot 'helpers/misc.ps1'; . $misc + +# Halt on any error (instead of PowerShell's default `Continue`). +$ErrorActionPreference = 'Stop' + + +# --- Dependency Definition --- +# One external dep for now: Casey Muratori's computer_enhance course repo. +$url_computer_enhance = 'https://github.com/cmuratori/computer_enhance.git' + +# --- Run --- +if ($NoPull) { clone-gitrepo $path_course_content $url_computer_enhance -NoPull } +else { clone-gitrepo $path_course_content $url_computer_enhance } + +write-host '' +write-host 'Course content up to date.'