add agentws prune
Agents leave their managed worktrees behind, and `agentws rm` takes one path at a time with no idea whether a branch's work is safely upstream, so clearing an accumulation by hand risks destroying unmerged commits. - classify every managed worktree: dirty, PR open, upstream, or unproven - remove only what is safe; delete the local branch only when work is upstream - prove "upstream" with merge-base and git cherry, so squash merges count - match a PR by head.label, which survives the branch deletion a merge does - dry run by default; --yes applies, --keep-branches spares every branch - read the Gitea path from origin's URL rather than assuming the owner
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// agentws new <repo> [--branch benvin/<name>] [--from <base-branch>]
|
||||
// agentws list
|
||||
// agentws rm <path-or-branch> [--delete-branch]
|
||||
// agentws prune [--yes] [--keep-branches]
|
||||
// agentws clean
|
||||
// agentws token
|
||||
// agentws credential get # git credential-helper protocol on stdin
|
||||
@@ -54,6 +55,7 @@ func newRootCmd() *cobra.Command {
|
||||
newNewCmd(),
|
||||
newListCmd(),
|
||||
newRmCmd(),
|
||||
newPruneCmd(),
|
||||
newCleanCmd(),
|
||||
newTokenCmd(),
|
||||
newCredentialCmd(),
|
||||
|
||||
Reference in New Issue
Block a user