Skip to content

doing pr create

Create a pull request.

doing pr create [flags]

Example usage

doing pr create 1234
doing pr create 1234 --draft -r "john.doe@company.com"
doing pr create 1234 --draft -r "john.doe@company.com jane.doe@company.com"
doing pr create 1234 --draft -r "@me jane.doe@company.com"
doing pr create 1234 --draft --checkout
doing pr create 1234 --delete-source-branch --self-approve --auto-complete
doing pr create 1234 --default-branch develop
doing pr create 1234 --branch-prefix "fix/"

doing will create a branch name using the format {work_item_id}_{issue_title}, where the {issue_title} is in lowercase, snake_case with all special characters removed. Example: issue #13 'Fix @ bug !' becomes 13_fix bug. If that branch already exists on the remote, doing will use that one.

If a new branch is created while doing pr create, it will be branched from the default branch in Azure Devops, which usually will be master, but might be a different branch. This can be The pull request will target this same branch. Where to branch from can be overridden by using the option -default-branch.

Options

Usage: doing pr create [OPTIONS] WORK_ITEM_ID

  Create a pull request from a work item ID.

  WORK_ITEM_ID is the work item ID that will be linked to the PR.

Options:
  --draft / --no-draft            Create draft/WIP pull request. Reviewers
                                  will not be notified until you publish.
                                  Default is --draft.  [env var:
                                  DOING_PR_CREATE_DRAFT]
  --auto-complete / --no-auto-complete
                                  Set the PR to complete autom. when all
                                  policies have passed. Default is --auto-
                                  complete.  [env var:
                                  DOING_PR_CREATE_AUTO_COMPLETE]
  --self-approve / --no-self-approve
                                  Add yourself as reviewer and add your
                                  approval. Default is --no-self-approve.
                                  [env var: DOING_PR_CREATE_SELF_APPROVE]
  -r, --reviewers TEXT            Space separated list of reviewer emails or
                                  aliases. Defaults to ""  [env var:
                                  DOING_PR_CREATE_REVIEWERS]
  --checkout / --no-checkout      Run git commands to checkout remote branch
                                  locally. Default is --checkout.  [env var:
                                  DOING_PR_CREATE_CHECKOUT]
  --delete-source-branch / --no-delete-source-branch
                                  Set to delete source branch when pull
                                  request completes. Default is --delete-
                                  source-branch.  [env var:
                                  DOING_PR_CREATE_DELETE_SOURCE_BRANCH]
  -w, --web / --no-web            Open newly created issue in the web browser.
                                  [env var: DOING_PR_CREATE_WEB]
  -b, --default-branch TEXT       The name of the branch to branch from and
                                  to. It overrides the repository's default
                                  branch.  [env var:
                                  DOING_PR_CREATE_DEFAULT_BRANCH]
  --branch-prefix TEXT            The prefix to be prepended to the branch
                                  name. Defaults to ""  [env var:
                                  DOING_PR_CREATE_BRANCH_PREFIX]
  --help                          Show this message and exit.

In use

Using user_aliases set in the config file:

doing pr create 1234 --reviewers 'john jane'
# > Created pull request #49281 'fixing a small typo'
#     > linked work item #1234
# ...
#     > added reviewers: 'John.Doe@company.com Jane.Doe@email.net'
# ... other (required) config items...
user_aliases:
    john: John.Doe@company.com
    jane: Jane.Doe@email.net

Using default_reviewers set in the config file:

doing pr create 1234
# > Created pull request #49281 'fixing a small typo'
#     > linked work item #1234
# ...
#     > added reviewers: 'John.Doe@company.com Jane.Doe@email.net'
# ... other (required) config items...
default_reviewers: "john jane"
user_aliases:
    john: John.Doe@company.com
    jane: Jane.Doe@email.net