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
41 changes: 41 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ chrono = { version = "0.4", features = ["serde"] }
[dev-dependencies]
insta = "1.39"
mockito = "1.4"
serial_test = "3.1"
tokio-test = "0.4"
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ With this graph built up, the tool can:
- Add a markdown table to the PR description (idempotently) of each PR in the stack describing _all_ PRs in the stack.
- Log a simple list of all PRs in the stack (+ dependencies) to stdout.
- Automatically update the stack + push after making local changes.
- **Land an entire stack** by squash-merging the topmost approved PR and closing the rest.

---

Expand Down Expand Up @@ -66,7 +67,8 @@ cargo install --force --path .
# Set the environment variable for the Github API token
$ export GHSTACK_OAUTH_TOKEN='<personal access token>'

# Set the environment variable for the repository owner/name
# Optional: The repository is auto-detected from your git remote.
# You can override it with an environment variable or the -r flag:
$ export GHSTACK_TARGET_REPOSITORY='<github repository name>'

# You can also set these in a `.gh-stack.env` file in the project root.
Expand All @@ -84,17 +86,18 @@ FLAGS:
SUBCOMMANDS:
annotate Annotate the descriptions of all PRs in a stack with metadata about all PRs in the stack
autorebase Rebuild a stack based on changes to local branches and mirror these changes up to the remote
land Land a stack by squash-merging the topmost approved PR and closing the rest
log Print a list of all pull requests in a stack to STDOUT
rebase Print a bash script to STDOUT that can rebase/update the stack (with a little help)

# Print a description of the stack to stdout. for a specific repository.
# Print a description of the stack to stdout (auto-detects repository from git remote)
$ gh-stack log 'stack-identifier'

# # Idempotently add a markdown table summarizing the stack
# to the description of each PR in the stack for a specific repository.
# Idempotently add a markdown table summarizing the stack
# to the description of each PR in the stack
$ gh-stack annotate 'stack-identifier'

# Same as above, but for the specified repository.
# Override auto-detected repository with -r flag
$ gh-stack annotate 'stack-identifier' -r '<some/repo>'

# Same as above, but with a custom title prefix.
Expand All @@ -116,6 +119,18 @@ $ gh-stack autorebase 'stack-identifier' -C /path/to/repo
# Same as above, but skips confirmation step.
$ gh-stack autorebase 'stack-identifier' -C /path/to/repo --ci

# Land the entire stack (squash-merges topmost approved PR, closes the rest)
$ gh-stack land 'stack-identifier'

# Preview what would happen without making changes
$ gh-stack land 'stack-identifier' --dry-run

# Skip approval requirement check
$ gh-stack land 'stack-identifier' --no-approval

# Only land the bottom N PRs in the stack
$ gh-stack land 'stack-identifier' --count 2

# Emit a bash script that can update a stack in the case of conflicts.
# WARNING: This script could potentially cause destructive behavior.
$ gh-stack rebase 'stack-identifier'
Expand Down
Loading