fix(worktree-lifecycle): address PR review feedback
- Rename update-pr to set-pr for clarity (it's setting the PR URL, not updating PR) - Add optional pr-url argument to kugetsu start command Usage: kugetsu start <issue-ref> <message> [pr-url] - If pr-url is provided at start, it's stored directly in session file
This commit is contained in:
@@ -78,7 +78,7 @@ Usage:
|
|||||||
kugetsu destroy <issue-ref> [-y] Delete session for issue
|
kugetsu destroy <issue-ref> [-y] Delete session for issue
|
||||||
kugetsu destroy --pm-agent [-y] Delete pm-agent session (not recommended)
|
kugetsu destroy --pm-agent [-y] Delete pm-agent session (not recommended)
|
||||||
kugetsu destroy --base [-y] Delete base session
|
kugetsu destroy --base [-y] Delete base session
|
||||||
kugetsu update-pr <issue-ref> <pr-url> Update PR URL for session (for PR tracking)
|
kugetsu set-pr <issue-ref> <pr-url> Set PR URL for session (for PR tracking)
|
||||||
kugetsu help Show this help
|
kugetsu help Show this help
|
||||||
|
|
||||||
Issue Ref Format:
|
Issue Ref Format:
|
||||||
@@ -1499,6 +1499,7 @@ EOF
|
|||||||
cmd_start() {
|
cmd_start() {
|
||||||
local issue_ref=""
|
local issue_ref=""
|
||||||
local message=""
|
local message=""
|
||||||
|
local pr_url=""
|
||||||
local args=("$@")
|
local args=("$@")
|
||||||
|
|
||||||
args=$(set_debug_mode "${args[@]}")
|
args=$(set_debug_mode "${args[@]}")
|
||||||
@@ -1508,11 +1509,14 @@ cmd_start() {
|
|||||||
issue_ref="$arg"
|
issue_ref="$arg"
|
||||||
elif [ -z "$message" ]; then
|
elif [ -z "$message" ]; then
|
||||||
message="$arg"
|
message="$arg"
|
||||||
|
elif [ -z "$pr_url" ]; then
|
||||||
|
pr_url="$arg"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -z "$issue_ref" ] || [ -z "$message" ]; then
|
if [ -z "$issue_ref" ] || [ -z "$message" ]; then
|
||||||
echo "Error: start requires <issue-ref> and <message>" >&2
|
echo "Error: start requires <issue-ref> and <message>" >&2
|
||||||
|
echo "Usage: kugetsu start <issue-ref> <message> [pr-url]" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1654,7 +1658,7 @@ session = {
|
|||||||
"created_at": "$(date -Iseconds)",
|
"created_at": "$(date -Iseconds)",
|
||||||
"state": "idle",
|
"state": "idle",
|
||||||
"branch_name": "$branch_name",
|
"branch_name": "$branch_name",
|
||||||
"pr_url": None
|
"pr_url": "$pr_url" if "$pr_url" else None
|
||||||
}
|
}
|
||||||
|
|
||||||
with open("$SESSIONS_DIR/$session_file", "w") as f:
|
with open("$SESSIONS_DIR/$session_file", "w") as f:
|
||||||
@@ -2021,12 +2025,12 @@ main() {
|
|||||||
destroy)
|
destroy)
|
||||||
cmd_destroy "$@"
|
cmd_destroy "$@"
|
||||||
;;
|
;;
|
||||||
update-pr)
|
set-pr)
|
||||||
local issue_ref="${1:-}"
|
local issue_ref="${1:-}"
|
||||||
local pr_url="${2:-}"
|
local pr_url="${2:-}"
|
||||||
if [ -z "$issue_ref" ] || [ -z "$pr_url" ]; then
|
if [ -z "$issue_ref" ] || [ -z "$pr_url" ]; then
|
||||||
echo "Usage: kugetsu update-pr <issue-ref> <pr-url>" >&2
|
echo "Usage: kugetsu set-pr <issue-ref> <pr-url>" >&2
|
||||||
echo "Example: kugetsu update-pr github.com/shoko/kugetsu#14 https://git.fbrns.co/shoko/kugetsu/pulls/123" >&2
|
echo "Example: kugetsu set-pr github.com/shoko/kugetsu#14 https://git.fbrns.co/shoko/kugetsu/pulls/123" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
validate_issue_ref "$issue_ref"
|
validate_issue_ref "$issue_ref"
|
||||||
|
|||||||
Reference in New Issue
Block a user