<commit_before># Sah

Sah is command line util for [Atlassian Bitbucket Server](https://www.atlassian.com/software/bitbucket/server).

This project was heavily inspired by the [hub](https://hub.github.com/).

## Installation

    gem install sah

## Configuration

    git config [--global] sah.profile.default.user "f440"
    git config [--global] sah.profile.default.password "<EMAIL>"
    git config [--global] sah.profile.default.url "https://exmaple.com"

If you use multiple Bitbucket Server, define profile(s) and specify it.

    git config [--global] sah.profile.my_company.user "jane"
    git config [--global] sah.profile.my_company.password "<PASSWORD>"
    git config [--global] sah.profile.my_company.url "https://git@exmaple.jp"

    sah SUB_COMMAND --profile my_company
    or
    export SAH_DEFAULT_PROFILE=my_company
    sah SUB_COMMAND

## Usage

### browse

    sah browse
    # browse current repository

    sah browse REPO
    # browse ~YOUR_NAME/REPO

    sah browse PROJECT/REPO
    # browse PROJECT/REPO

    sah browse --branch
    # browse branch list in current repository

    sah browse --branch BRANCH
    # browse BRANCH in current repository

    sah browse --commit COMMITHASH
    # browse COMMITHASH in current repository

    sah browse --pull-request
    # browse pull request list in current repository

    sah browse --pull-request PULL_REQUEST
    # browse PULL_REQUEST in current repository

### clone

    sah clone PROJECT/REPO
    > git clone ssh://git@example.com:7999/PROJECT/REPO

    sah clone REPO
    > git clone ssh://git@example.com:7999/~YOUR_NAME/ERPO

    sah clone ~USERNAME/REPO
    > git clone ssh://git@example.com:7999/~USERNAME/REPO

### create

    sah create
    # create repository
    # repository name is same as the current repository

    sah create --name REPO
    # create repository at ~YOUR_NAME/REPO

    sah create PROJECT
    # create repository at PROJECT
    # repository name is same as the current repository

### fork

    sah fork
    # fork from current repository to ~YOUR_NAME/REPO
    # repository name is same as the origin's one

    sah fork --name MY_FORKED_REPO
    # fork from current repository to ~YOUR_NAME/MY_FORKED_REPO

    sah fork PROJECT/REPO
    # fork from PROJECT/REPO to ~YOUR_NAME/REPO

    sah fork ~USERNAME/REPO
    # fork from ~USERNAME/REPO to ~YOUR_NAME/REPO

### help

    sah help [COMMAND]
    # Describe available commands or one specific command

### project

    sah project
    # list projects

    sah project PROJECT
    # show project detail

### pull-request

   sah pull-request
   # create pull-request to upstream repository's default branch
   # open $EDITOR to edit title and description
<commit_msg>Fix document indentation<commit_after># Sah

Sah is command line util for [Atlassian Bitbucket Server](https://www.atlassian.com/software/bitbucket/server).

This project was heavily inspired by the [hub](https://hub.github.com/).

## Installation

    gem install sah

## Configuration

    git config [--global] sah.profile.default.user "f440"
    git config [--global] sah.profile.default.password "<EMAIL>"
    git config [--global] sah.profile.default.url "https://exmaple.com"

If you use multiple Bitbucket Server, define profile(s) and specify it.

    git config [--global] sah.profile.my_company.user "jane"
    git config [--global] sah.profile.my_company.password "<PASSWORD>"
    git config [--global] sah.profile.my_company.url "https://git@exmaple.jp"

    sah SUB_COMMAND --profile my_company
    or
    export SAH_DEFAULT_PROFILE=my_company
    sah SUB_COMMAND

## Usage

### browse

    sah browse
    # browse current repository

    sah browse REPO
    # browse ~YOUR_NAME/REPO

    sah browse PROJECT/REPO
    # browse PROJECT/REPO

    sah browse --branch
    # browse branch list in current repository

    sah browse --branch BRANCH
    # browse BRANCH in current repository

    sah browse --commit COMMITHASH
    # browse COMMITHASH in current repository

    sah browse --pull-request
    # browse pull request list in current repository

    sah browse --pull-request PULL_REQUEST
    # browse PULL_REQUEST in current repository

### clone

    sah clone PROJECT/REPO
    > git clone ssh://<EMAIL>:7999/PROJECT/REPO

    sah clone REPO
    > git clone ssh://<EMAIL>:7999/~YOUR_NAME/ERPO

    sah clone ~USERNAME/REPO
    > git clone ssh://<EMAIL>:7999/~USERNAME/REPO

### create

    sah create
    # create repository
    # repository name is same as the current repository

    sah create --name REPO
    # create repository at ~YOUR_NAME/REPO

    sah create PROJECT
    # create repository at PROJECT
    # repository name is same as the current repository

### fork

    sah fork
    # fork from current repository to ~YOUR_NAME/REPO
    # repository name is same as the origin's one

    sah fork --name MY_FORKED_REPO
    # fork from current repository to ~YOUR_NAME/MY_FORKED_REPO

    sah fork PROJECT/REPO
    # fork from PROJECT/REPO to ~YOUR_NAME/REPO

    sah fork ~USERNAME/REPO
    # fork from ~USERNAME/REPO to ~YOUR_NAME/REPO

### help

    sah help [COMMAND]
    # Describe available commands or one specific command

### project

    sah project
    # list projects

    sah project PROJECT
    # show project detail

### pull-request

    sah pull-request
    # create pull-request to upstream repository's default branch
    # open $EDITOR to edit title and description

{'fraction_non_alphanumeric': 0.08370044052863436, 'fraction_numerical': 0.005506607929515419, 'mean_word_length': 2.9802775748721695, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 16, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 5, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6828217', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1647, 'n_words': 550}