Skip to content

Commit

Permalink
Add a --remote switch to new_proposal.py (#4681)
Browse files Browse the repository at this point in the history
If the user's fork is not named 'origin' then the script will fail and
needs to know the user's remote name.

Fixes #1899
  • Loading branch information
danakj authored Dec 13, 2024
1 parent c7ae2a7 commit 18d9935
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion proposals/scripts/new_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ def _parse_args(args: Optional[List[str]] = None) -> argparse.Namespace:
help="The name of the branch. Automatically generated from the title "
"by default.",
)
parser.add_argument(
"--remote",
metavar="REMOTE",
default="origin",
help="The git remote name where the branch will be pushed. Defaults to "
"'origin'.",
)
parser.add_argument(
"--proposals-dir",
metavar="PROPOSALS_DIR",
Expand Down Expand Up @@ -177,7 +184,7 @@ def main() -> None:
_run(
[git_bin, "switch", "--create", branch, parsed_args.branch_start_point]
)
_run([git_bin, "push", "-u", "origin", branch])
_run([git_bin, "push", "-u", parsed_args.remote, branch])

# Copy template.md to a temp file.
template_path = os.path.join(proposals_dir, "scripts/template.md")
Expand Down

0 comments on commit 18d9935

Please sign in to comment.