more swag
This commit is contained in:
20
justfile
20
justfile
@@ -736,6 +736,23 @@ remote-branch $remote_ref=`just _a_remote_branch origin | cut -d/ -f2-`:
|
||||
# TODO: onto release-xx.yy doesn't work
|
||||
|
||||
# TODO: python-updates
|
||||
checkout-commit-in-worktree $commit=`just _a_commit`:
|
||||
#!/usr/bin/env -S bash -euo pipefail
|
||||
[[ -n "${commit:-}" ]]
|
||||
if [[ -d tmp/commit-"$commit" ]]; then
|
||||
echo >&2 "Commit already checked out, cd'ing there..."
|
||||
else
|
||||
(
|
||||
cd master
|
||||
$GIT worktree prune
|
||||
# TODO: fetch the commit from upstream if it doesn't exist?
|
||||
# TODO: support github /commit/ urls?
|
||||
$GIT worktree add ../tmp/commit-"$commit" "$commit"
|
||||
)
|
||||
fi
|
||||
cd tmp/commit-"$commit"
|
||||
exec just _enter_interactive_shell
|
||||
|
||||
@new-worktree *args:
|
||||
cd "$(just _new_worktree "$@")"; exec just _enter_interactive_shell
|
||||
|
||||
@@ -1408,9 +1425,10 @@ _enter_interactive_shell *_:
|
||||
builtin printf "\e]7;kitty-shell-cwd://%s%s\a" "$HOSTNAME" "$PWD"
|
||||
fi
|
||||
fi
|
||||
# TODO: skip if no tty?
|
||||
# TODO: -l ?
|
||||
exec "$SHELL" "$@"
|
||||
# TODO: go back to the old PWD here
|
||||
# TODO: somehow report the old PWD here, will require i rethink the use of [no-cd] and maybe instead accept the new working dir via an argument
|
||||
|
||||
# maintenance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user