diff --git a/justfile b/justfile index 7f61e8c..98949b1 100644 --- a/justfile +++ b/justfile @@ -510,12 +510,30 @@ 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`: +bisect-eval $attrpath=`just _a_package` *_: #!/usr/bin/env -S bash -euo pipefail - [[ -n "$repro_cmd" ]] + tmpfile=$(mktemp) + hello + printf "#!/usr/bin/env -S bash -euxo pipefail\nnix-instantiate --json --strict --eval --system %q . -A %q" "$(just _a_system)" "$attrpath" > "$tmpfile" + chmod +x "$tmpfile" + just bisect-script "$tmpfile" "${@:2}" + +[no-cd] +bisect-build $attrpath=`just _a_package` *_: + #!/usr/bin/env -S bash -euo pipefail + tmpfile=$(mktemp) + # printf "#!/usr/bin/env -S bash -euxo pipefail\nnix-build --no-out-link $(gum choose -- "" "-j0") --system %q . -A %q" "$(just _a_system)" "$attrpath" > "$tmpfile" + printf "#!/usr/bin/env -S bash -euxo pipefail\nnom-build --no-out-link $(gum choose -- "" "-j0") --system %q . -A %q" "$(just _a_system)" "$attrpath" > "$tmpfile" + chmod +x "$tmpfile" + just bisect-script "$tmpfile" "${@:2}" + +[no-cd] +bisect-script $repro_script $bad_commit=`cd "$invokedir"; HEADER="Bad commit" just _a_commit` $good_commit=`cd "$invokedir"; HEADER="Good commit" just _a_commit`: + #!/usr/bin/env -S bash -euo pipefail + [[ -n "$repro_script" ]] [[ -n "$good_commit" ]] [[ -n "$bad_commit" ]] - #[[ -x "$repro_cmd" ]] || ! echo >&2 "ERROR: '$repro_cmd' is not an executable file!" || false + [[ -x "$repro_script" ]] || ! echo >&2 "ERROR: '$repro_script' 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." @@ -524,8 +542,9 @@ bisect $repro_cmd $bad_commit=`just _a_commit` $good_commit=`just _a_commit`: 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" + $GIT bisect run "$repro_script" ) + echo >&2 "Continue with '$GIT bisect run \"$repro_script\"'" echo >&2 "Conclude with 'git bisect reset'" # === pr helper === @@ -553,6 +572,11 @@ push-new-pr: else gh pr create --base="$base" fi + if gum confirm "Enqueue nixpkgs-review?"; then + pr_number="$(gh pr list --author @me | column -s$'\t' -t | gum choose | cut -d' ' -f1)" + [[ -n "$pr_number" ]] + just enqueue-nixpkgs-review "$pr_number" + fi # === speed worktrees === @@ -562,7 +586,7 @@ bump-new-worktree *packages: [[ "${#packages[@]}" -gt 0 ]] || readarray -td $'\n' packages <<<"$( just _some_packages )" [[ "${#packages[@]}" -gt 0 ]] export JUST_SYSTEM="$(just _a_system)" - just get-versions "${packages[0]}" # TODO: timeout? + gum confirm --default=no "Check versions on all branches?" && just get-versions "${packages[0]}" ||: # TODO: timeout? worktree=$(just _new_worktree bump "$(printf "%s\n" "${packages[0]}" | rev | cut -d. -f1 | rev)") [[ -n "$worktree" ]] [[ -d "$worktree" ]] @@ -990,8 +1014,7 @@ _mk_clean_list: if ( cd "$path" ! $GIT diff HEAD --quiet --exit-code >&/dev/null || - $GIT ls-files --others --exclude-standard | - grep -qEv '^(update-executables\.txt|results(-.*)?|build\.nix|(asd|do|foo|test|spismeg|packages|notes)[2-9]?\.(sh|txt|json)|diff\.patch|patch\.diff|(packages(_?[0-9]+))\.json|[^/]*\.log)$' + $GIT ls-files --others --exclude-standard | grep -q / # ignore toplevel dirty files ) ; then continue fi @@ -1136,6 +1159,7 @@ enqueue-nixpkgs-review *$prs: gum choose \ $'' \ $'bolle\t~/repos/nixpkgs/master/' \ + $'eple\t~/repos/nixpkgs/master/' \ $'garp\t~/repos/nixpkgs/master/' )" gum confirm @@ -1244,7 +1268,7 @@ _a_commit *extra_revs: { [[ $# -eq 0 ]] || printf "%s\n" "$@"; cd "$invokedir"; nice -n5 $GIT log --oneline "${extra_args[@]}" ||: # fails when stdout is closed early - } | fzf --reverse --header="Pick commit..." | cut -d' ' -f1 | grep . + } | fzf --reverse --header="${HEADER:-Pick commit...}" | cut -d' ' -f1 | grep . _some_commits *extra_revs: #!/usr/bin/env -S bash -euo pipefail @@ -1255,7 +1279,7 @@ _some_commits *extra_revs: { [[ $# -eq 0 ]] || printf "%s\n" "$@"; cd "$invokedir"; nice -n5 $GIT log --oneline "${extra_args[@]}" ||: # fails when stdout is closed early - } | fzf --reverse --header="Pick commit..." --multi | cut -d' ' -f1 | grep . + } | fzf --reverse --header="${HEADER:-Pick commit...}" --multi | cut -d' ' -f1 | grep . @_a_commit_title: cd "$invokedir"; rev="$(just _a_commit)" || exit $?; [[ -n "$rev" ]] && git log --format="%s" -n1 "$rev" | grep .