From c1df5793ac122feefd963e85ceef6efb11c791e0 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 6 Jun 2025 22:41:11 +0200 Subject: [PATCH] ljksdlkasdlkj --- justfile | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index 4e2dcd3..ed7b368 100644 --- a/justfile +++ b/justfile @@ -445,7 +445,13 @@ _build_package_sources $system +packages: commit-dirty-packages +$message=`gum input --placeholder="commit message, (attrpath: this message)"`: #!/usr/bin/env -S bash -euo pipefail [[ -n "$message" ]] - $GIT ls-files --modified | sort -u | xe nixfmt --check || ! echo >&2 "Consider running 'just format-files-dirty'" || false + if ! $GIT ls-files --modified | sort -u | xe -j0 nixfmt --check; then + if gum confirm "Run 'just format-files-dirty'?"; then + just format-files-dirty + else + false + fi + fi just list-dirty-packages | while read attrpath position row; do [[ -f "$position" ]] || continue @@ -487,6 +493,25 @@ fixup-commit-staged commit=`cd "$invokedir"; just _a_commit`: rebase-commits commit=`cd "$invokedir"; just _a_commit`: cd "$invokedir"; $GIT rebase -i --autostash --autosquash "$($GIT log -n1 --pretty=%P {{ commit }})" +[no-cd] +bisect $repro_cmd $bad_commit=`just _a_commit` $good_commit=`just _a_commit`: + #!/usr/bin/env -S bash -euo pipefail + [[ -n "$repro_cmd" ]] + [[ -n "$good_commit" ]] + [[ -n "$bad_commit" ]] + #[[ -x "$repro_cmd" ]] || ! echo >&2 "ERROR: '$repro_cmd' is not an executable file!" || false + declare -a args=() + declare -a possible_args=( + "--first-parent Follow only the first parent commit upon seeing a merge commit." + "--no-checkout Do not checkout the new working tree, instead just update BISECT_HEAD " + ) + readarray -td $'\n' args < <(gum choose --no-limit -- "${possible_args[@]}" | cut -d' ' -f1) + (set -x + $GIT bisect start "${args[@]}" "$bad_commit" "$good_commit" -- + $GIT bisect run "$repro_cmd" + ) + echo >&2 "Conclude with 'git bisect reset'" + # === pr helper === [no-cd] @@ -921,7 +946,7 @@ get-maintainers-for-packages *attrpaths: _packages_json [[ "${#attrpaths[@]}" -gt 0 ]] #grep >"${cachefile}.staging" + [[ "$(wc -l <<<"$resp" )" -ge 100 ]] + do true; done + + sort <"${cachefile}.staging" -u --ignore-case > "$cachefile" + rm "${cachefile}.staging" + fi + + _a_pr: #!/usr/bin/env -S bash -euo pipefail [[ -n "${JUST_PR:-}" ]] && { head -n1 <<<"$JUST_PR"; exit 0; } ||: