Skip to content

bb commit

List, show and compare commits, and find a commit's pull requests

4 commands.

bb commit compare
Compare two commits or refs
bb commit get
Get a specific commit
bb commit list
List repository commits
bb commit prs
List pull requests containing a commit

bb commit compare

Compare two commits or refs

bb commit compare <from> <to> [flags]

List the commits reachable from <from> but not from <to>: what <from> has that <to> lacks. Pass the ref you are asking about first; git log's range puts it last.

bb commit compare feature/x main        # commits feature/x adds
bb commit compare <failing> <green>     # commits since the last green build
# The commits feature/x adds to main
bb commit compare feature/x main --repo PROJ/repo
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)

Inherited from bb commit:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository             object
    projectKey           string                  Project key the repository belongs to.
    slug                 string                  Repository slug.
  commits                list of object or null  Matching commits, newest first.
    id?                  string                  Full 40-character SHA1.
    displayId?           string                  Abbreviated SHA1 as Bitbucket renders it.
    message?             string                  Full commit message, including the body.
    author?              object                  Who wrote the change.
      name?              string                  Display name.
      emailAddress?      string                  Email address, when the instance exposes it.
      avatarUrl?         string                  URL of the avatar image, when one is configured.
    authorTimestamp?     integer                 When the change was written, in milliseconds since the epoch.
    committer?           object                  Who committed the change.
      name?              string                  Display name.
      emailAddress?      string                  Email address, when the instance exposes it.
      avatarUrl?         string                  URL of the avatar image, when one is configured.
    committerTimestamp?  integer                 When the change was committed, in milliseconds since the epoch.
    parents?             list of string          Commit ids of the parents.

bb commit get

Get a specific commit

bb commit get <commit>
# One commit: author, message and parents
bb commit get a1b2c3d --repo PROJ/repo

Inherited from bb commit:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository             object
    projectKey           string          Project key the repository belongs to.
    slug                 string          Repository slug.
  commit                 object
    id?                  string          Full 40-character SHA1.
    displayId?           string          Abbreviated SHA1 as Bitbucket renders it.
    message?             string          Full commit message, including the body.
    author?              object          Who wrote the change.
      name?              string          Display name.
      emailAddress?      string          Email address, when the instance exposes it.
      avatarUrl?         string          URL of the avatar image, when one is configured.
    authorTimestamp?     integer         When the change was written, in milliseconds since the epoch.
    committer?           object          Who committed the change.
      name?              string          Display name.
      emailAddress?      string          Email address, when the instance exposes it.
      avatarUrl?         string          URL of the avatar image, when one is configured.
    committerTimestamp?  integer         When the change was committed, in milliseconds since the epoch.
    parents?             list of string  Commit ids of the parents.

bb commit list

List repository commits

bb commit list [flags]
# The latest commits
bb commit list --repo PROJ/repo

# The last ten that touched a file
bb commit list --repo PROJ/repo --path src/main.go --limit 10

# The ones Bitbucket links to a Jira issue
bb commit list --repo PROJ/repo --jira PAY-128
--all
Return every result rather than the first --limit
--jira string
List commits associated with a Jira issue key
--limit int
Maximum number of results to return (default 25)
--path string
Filter commits by file path
--start int
Start offset for list operations

Inherited from bb commit:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository             object
    projectKey           string                  Project key the repository belongs to.
    slug                 string                  Repository slug.
  commits                list of object or null  Matching commits, newest first.
    id?                  string                  Full 40-character SHA1.
    displayId?           string                  Abbreviated SHA1 as Bitbucket renders it.
    message?             string                  Full commit message, including the body.
    author?              object                  Who wrote the change.
      name?              string                  Display name.
      emailAddress?      string                  Email address, when the instance exposes it.
      avatarUrl?         string                  URL of the avatar image, when one is configured.
    authorTimestamp?     integer                 When the change was written, in milliseconds since the epoch.
    committer?           object                  Who committed the change.
      name?              string                  Display name.
      emailAddress?      string                  Email address, when the instance exposes it.
      avatarUrl?         string                  URL of the avatar image, when one is configured.
    committerTimestamp?  integer                 When the change was committed, in milliseconds since the epoch.
    parents?             list of string          Commit ids of the parents.

bb commit prs

List pull requests containing a commit

bb commit prs <commit>
# The pull requests a commit is part of
bb commit prs a1b2c3d --repo PROJ/repo

Inherited from bb commit:

--repo string
Repository as PROJECT/slug (defaults to the repository of the git checkout you are in, then BITBUCKET_PROJECT_KEY + BITBUCKET_REPO_SLUG)

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data
  repository            object
    projectKey          string                          Project key the repository belongs to.
    slug                string                          Repository slug.
  pullRequests          list of object or null          Pull requests containing the commit.
    id                  integer                         Pull request number, unique within the repository.
    title               string                          Pull request title.
    description?        string                          Body text, when one was written.
    state               OPEN|MERGED|DECLINED
    open                boolean                         Whether the pull request is still open.
    closed              boolean                         Whether the pull request is merged or declined.
    draft?              boolean                         Whether it is marked as a draft.
    repository?         object                          Repository the pull request merges into.
      projectKey        string                          Project key the repository belongs to.
      slug              string                          Repository slug.
    sourceRepository?   object                          Repository the source branch lives in.
      projectKey        string                          Project key the repository belongs to.
      slug              string                          Repository slug.
    version             integer                         Optimistic-locking version.
    author?             string                          Display name of whoever opened it.
    authorUsername?     string                          Username of whoever opened it.
    sourceBranch?       string                          Branch being merged from.
    targetBranch?       string                          Branch being merged into.
    sourceCommit?       string                          Head commit of the source branch when this was read.
    createdDate?        integer                         When it was opened, in milliseconds since the epoch.
    updatedDate?        integer                         When it last changed, in milliseconds since the epoch.
    closedDate?         integer                         When it was merged or declined, in milliseconds since the epoch.
    url?                string                          Where the pull request is in Bitbucket, as the server links to
                                                        it.
    issueKeys?          list of string                  Issue keys the title and source branch mention, such as
                                                        PROJ-123, in the order they appear.
    reviewers?          list of object                  Everyone asked to review, with where they got to.
      name?             string                          Username.
      displayName?      string                          Human-readable name.
      email?            string                          Email address, when the instance exposes it.
      role?             AUTHOR|REVIEWER|PARTICIPANT     REVIEWER or PARTICIPANT.
      status?           UNAPPROVED|NEEDS_WORK|APPROVED
      approved          boolean                         Whether this reviewer has approved.
    mergeability?       object                          Whether it can merge.
      mergeable         boolean                         Whether Bitbucket would accept a merge right now.
      outcome?          CLEAN|CONFLICTED|UNKNOWN
      conflicted        boolean                         Whether the merge would conflict.
      blockers?         list of object                  Merge checks currently refusing.
        summary?        string                          Short reason, as Bitbucket phrases it.
        detail?         string                          Longer explanation, when the instance gives one.
    commentCount?       integer                         Comments on the pull request.
    openTaskCount?      integer                         Unresolved tasks.
    resolvedTaskCount?  integer                         Resolved tasks.