@@ -23,6 +23,7 @@ With this graph built up, the tool can:
2323- Add a markdown table to the PR description (idempotently) of each PR in the stack describing _ all_ PRs in the stack.
2424- Log a simple list of all PRs in the stack (+ dependencies) to stdout.
2525- Automatically update the stack + push after making local changes.
26+ - ** Land an entire stack** by squash-merging the topmost approved PR and closing the rest.
2627
2728---
2829
@@ -66,7 +67,8 @@ cargo install --force --path .
6667# Set the environment variable for the Github API token
6768$ export GHSTACK_OAUTH_TOKEN=' <personal access token>'
6869
69- # Set the environment variable for the repository owner/name
70+ # Optional: The repository is auto-detected from your git remote.
71+ # You can override it with an environment variable or the -r flag:
7072$ export GHSTACK_TARGET_REPOSITORY=' <github repository name>'
7173
7274# You can also set these in a `.gh-stack.env` file in the project root.
@@ -84,17 +86,18 @@ FLAGS:
8486SUBCOMMANDS:
8587 annotate Annotate the descriptions of all PRs in a stack with metadata about all PRs in the stack
8688 autorebase Rebuild a stack based on changes to local branches and mirror these changes up to the remote
89+ land Land a stack by squash-merging the topmost approved PR and closing the rest
8790 log Print a list of all pull requests in a stack to STDOUT
8891 rebase Print a bash script to STDOUT that can rebase/update the stack (with a little help)
8992
90- # Print a description of the stack to stdout. for a specific repository.
93+ # Print a description of the stack to stdout (auto-detects repository from git remote)
9194$ gh-stack log ' stack-identifier'
9295
93- # # Idempotently add a markdown table summarizing the stack
94- # to the description of each PR in the stack for a specific repository.
96+ # Idempotently add a markdown table summarizing the stack
97+ # to the description of each PR in the stack
9598$ gh-stack annotate ' stack-identifier'
9699
97- # Same as above, but for the specified repository.
100+ # Override auto-detected repository with -r flag
98101$ gh-stack annotate ' stack-identifier' -r ' <some/repo>'
99102
100103# Same as above, but with a custom title prefix.
@@ -116,6 +119,18 @@ $ gh-stack autorebase 'stack-identifier' -C /path/to/repo
116119# Same as above, but skips confirmation step.
117120$ gh-stack autorebase ' stack-identifier' -C /path/to/repo --ci
118121
122+ # Land the entire stack (squash-merges topmost approved PR, closes the rest)
123+ $ gh-stack land ' stack-identifier'
124+
125+ # Preview what would happen without making changes
126+ $ gh-stack land ' stack-identifier' --dry-run
127+
128+ # Skip approval requirement check
129+ $ gh-stack land ' stack-identifier' --no-approval
130+
131+ # Only land the bottom N PRs in the stack
132+ $ gh-stack land ' stack-identifier' --count 2
133+
119134# Emit a bash script that can update a stack in the case of conflicts.
120135# WARNING: This script could potentially cause destructive behavior.
121136$ gh-stack rebase ' stack-identifier'
0 commit comments