diff --git a/justfile b/justfile index b56eea7..adda5ef 100644 --- a/justfile +++ b/justfile @@ -332,6 +332,21 @@ 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 }})" +# === pr helper === + +[no-cd] +push-new-pr: + #!/usr/bin/env -S bash -euo pipefail -x + # TODO: verify "origin" is a nixpkgs fork and not NixOS/nixpkgs + title=$(just _a_commit_title ||:) + $GIT -c push.autoSetupRemote=true push origin + if [[ -n "$title" ]]; then + gh pr create --title="$title" + else + gh pr create + fi + + # === speed worktrees === bump *packages: @@ -702,15 +717,18 @@ _packages_json: @_a_commit *extra_revs: # TODO: check if in a nixpkgs git repo { \ - test $# -eq 0 || printf "%s\n" "$@"; \ + [[ $# -eq 0 ]] || printf "%s\n" "$@"; \ cd "$invokedir"; $GIT log --oneline -n800; \ - } | gum filter --placeholder "Pick commit..." --height 10 | cut -d' ' -f1 + } | gum filter --placeholder "Pick commit..." --height 10 | cut -d' ' -f1 | grep . @_some_commits: # TODO: check if in a git repo #cd "$invokedir"; $GIT log --oneline -n800 | gum filter --placeholder "Pick commit..." --height 10 --no-limit | cut -d' ' -f1 cd "$invokedir"; $GIT log --oneline -n800 | fzf --layout=reverse --multi --height 15 | cut -d' ' -f1 +@_a_commit_title: + cd "$invokedir"; rev="$(just _a_commit)" || exit $?; [[ -n "$rev" ]] && git log --format="%s" -n1 "$rev" | grep . + @_a_package: _packages_json #gum spin --show-output just list-packages | cut -f1 | fzf --sync --layout=reverse --height 15 | grep . just list-packages >/dev/null