Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ uv run pre-commit install
- `flow rebase` — rebase the current branch onto the latest default branch
- `flow push` — force-push the current branch (refused on the default branch)
- `flow clean` — delete local branches whose PRs have been merged
- `flow dirty` — show the stash list and all local branches
16 changes: 14 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func run(name string, args ...string) {
func main() {
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "usage: flow <command> [args]\n")
fmt.Fprintf(os.Stderr, "commands: branch, create, view, merge, clean, rebase, push\n")
fmt.Fprintf(os.Stderr, "commands: branch, create, view, merge, clean, rebase, push, dirty\n")
os.Exit(2)
}

Expand All @@ -49,9 +49,11 @@ func main() {
cmdRebase(os.Args[2:])
case "push":
cmdPush(os.Args[2:])
case "dirty":
cmdDirty(os.Args[2:])
default:
fmt.Fprintf(os.Stderr, "flow: unknown command %q\n", os.Args[1])
fmt.Fprintf(os.Stderr, "commands: branch, create, view, merge, clean, rebase, push\n")
fmt.Fprintf(os.Stderr, "commands: branch, create, view, merge, clean, rebase, push, dirty\n")
os.Exit(2)
}
}
Expand Down Expand Up @@ -228,6 +230,16 @@ func cmdPush(args []string) {
run("git", "push", "--force")
}

func cmdDirty(args []string) {
if len(args) > 0 {
fmt.Fprintf(os.Stderr, "usage: flow dirty\n")
os.Exit(2)
}

run("git", "stash", "list")
run("git", "branch")
}

func cmdRebase(args []string) {
if len(args) > 0 {
fmt.Fprintf(os.Stderr, "usage: flow rebase\n")
Expand Down
Loading