From a6656cb2ef94e8e7d8f14edc4389ef5a818fb47f Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Tue, 5 May 2026 23:41:50 -0400 Subject: [PATCH 1/2] Update [ghstack-poisoned] --- src/ghstack/cli.py | 75 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/src/ghstack/cli.py b/src/ghstack/cli.py index 7e88876..d59d2f5 100644 --- a/src/ghstack/cli.py +++ b/src/ghstack/cli.py @@ -49,22 +49,71 @@ def cli_context( yield shell, config, github -@click.group(invoke_without_command=True) +@click.group( + invoke_without_command=True, + epilog="Running ghstack with no subcommand is equivalent to ghstack submit.", +) @click.pass_context @click.version_option(ghstack.__version__, "--version", "-V") @click.option("--debug", is_flag=True, help="Log debug information to stderr") -# hidden arguments that we'll pass along to submit if no other command given -@click.option("--message", "-m", default="Update", hidden=True) -@click.option("--update-fields", "-u", is_flag=True, hidden=True) -@click.option("--short", is_flag=True, hidden=True) -@click.option("--force", is_flag=True, hidden=True) -@click.option("--no-skip", is_flag=True, hidden=True) -@click.option("--draft", is_flag=True, hidden=True) +# These options are forwarded to the submit command when no subcommand is given. +@click.option( + "--message", + "-m", + default="Update", + help="Description of change you made", +) +@click.option( + "--update-fields", + "-u", + is_flag=True, + help="Update GitHub pull request summary from the local commit", +) +@click.option( + "--short", is_flag=True, help="Print only the URL of the latest opened PR to stdout" +) +@click.option( + "--force", + is_flag=True, + help="force push the branch even if your local branch is stale", +) +@click.option( + "--no-skip", + is_flag=True, + help="Never skip pushing commits, even if the contents didn't change", +) +@click.option( + "--draft", + is_flag=True, + help="Create the pull request in draft mode (only if it has not already been created)", +) +@click.option( + "--direct/--no-direct", "direct_opt", is_flag=True, default=None, + help="Create stack that directly merges into master", +) +@click.option( + "--base", + "-B", + default=None, + help="Branch to base the stack off of", +) +@click.option( + "--stack/--no-stack", + "-s/-S", + is_flag=True, + default=True, + help="Submit the entire stack of commits reachable from HEAD", +) @click.option( - "--direct/--no-direct", "direct_opt", is_flag=True, hidden=True, default=None + "--reviewer", + default=None, + help="Comma-separated list of GitHub usernames to add as reviewers", +) +@click.option( + "--label", + default=None, + help="Comma-separated list of labels to add to new PRs", ) -@click.option("--base", "-B", default=None, hidden=True) -@click.option("--stack/--no-stack", "-s/-S", is_flag=True, default=True, hidden=True) def main( ctx: click.Context, debug: bool, @@ -77,6 +126,8 @@ def main( draft: bool, base: Optional[str], stack: bool, + reviewer: Optional[str], + label: Optional[str], ) -> None: """ Submit stacks of diffs to Github @@ -101,6 +152,8 @@ def main( base=base, stack=stack, direct_opt=direct_opt, + reviewer=reviewer, + label=label, ) From 4db90d5c5e8afd8737cc1d97ae413fe393d5f742 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Wed, 6 May 2026 10:58:25 -0400 Subject: [PATCH 2/2] Update [ghstack-poisoned] --- CLAUDE.md | 5 +++++ src/ghstack/cli.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..c1ef2d5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,5 @@ +# ghstack development + +## Lint + +Run `python -m black src/ghstack/` and `python -m flake8 src/ghstack/` to fix and check lint before committing. diff --git a/src/ghstack/cli.py b/src/ghstack/cli.py index d59d2f5..d0c3f61 100644 --- a/src/ghstack/cli.py +++ b/src/ghstack/cli.py @@ -88,7 +88,10 @@ def cli_context( help="Create the pull request in draft mode (only if it has not already been created)", ) @click.option( - "--direct/--no-direct", "direct_opt", is_flag=True, default=None, + "--direct/--no-direct", + "direct_opt", + is_flag=True, + default=None, help="Create stack that directly merges into master", ) @click.option(