diff --git a/justfile b/justfile index 9af701d..bd3cc27 100644 --- a/justfile +++ b/justfile @@ -764,15 +764,17 @@ _mk_worktree $name $dir $base="upstream/master" $onto="": [[ -n "$base" ]] remote="$(cut -d/ -f1 <<<"$base")" branch="$(cut -d/ -f2- <<<"$base")" + # TODO: use upstream/master/? cd master $GIT worktree prune $GIT fetch "$remote" "$branch" - $GIT branch "$name" "$branch" --no-track + #$GIT branch "$name" "$branch" --no-track + $GIT branch "$name" "$base" --no-track $GIT worktree add ../"$dir" "$name" cd ../"$dir" # TODO: use this to determine base instead of using rebase-onto: baserev="$(git merge-base "$base" "$onto")" $GIT pull --rebase "$remote" "$branch" - [[ -z "$onto" ]] || just rebase-onto HEAD "$onto" + [[ -z "$onto" ]] || just rebase-onto HEAD "$onto" # TODO: resolve the shared ancestor rev and make the worktree with it as base instead? cherry-pick-commits-here *commits: #!/usr/bin/env -S bash -euo pipefail -x @@ -1224,7 +1226,7 @@ _a_commit *extra_revs: [[ -z "${GIT_LOG_ALL:-}" ]] || extra_args+=(--all) { [[ $# -eq 0 ]] || printf "%s\n" "$@"; - cd "$invokedir"; nice -n5 $GIT log --oneline "${extra_args[@]}" || : + cd "$invokedir"; nice -n5 $GIT log --oneline "${extra_args[@]}" ||: # fails when stdout is closed early } | fzf --reverse --header="Pick commit..." | cut -d' ' -f1 | grep . _some_commits *extra_revs: @@ -1235,7 +1237,7 @@ _some_commits *extra_revs: [[ -z "${GIT_LOG_ALL:-}" ]] || extra_args+=(--all) { [[ $# -eq 0 ]] || printf "%s\n" "$@"; - cd "$invokedir"; nice -n5 $GIT log --oneline "${extra_args[@]}"; + 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 . @_a_commit_title: