diff --git a/README.md b/README.md index 9013712..3e15ceb 100644 --- a/README.md +++ b/README.md @@ -280,6 +280,19 @@ export JIRA_OK_ID="xx" #export GIT_MR_TIMEOUT=10 ``` +Environment-only configuration: +```bash +## What to show as merge request title in `git mr menu status`. Available values: +## - "both": Merge request title and branch (default) +## - "title": Merge request title only +## - "branch": Merge request source branch only +#GIT_MR_MENU_STATUS_SHOW=both + +## Separator between merge request title and branch when GIT_MR_MENU_STATUS_SHOW=both +#GIT_MR_MENU_STATUS_TITLE_BRANCH_SEPARATOR=" " # default +#GIT_MR_MENU_STATUS_TITLE_BRANCH_SEPARATOR="\n " # send to the next line +``` + #### Jira & Gitlab tokens To create a Jira API Token, go to: diff --git a/doc/generate-sample-output.sh b/doc/generate-sample-output.sh index 6e401d2..2fe7636 100755 --- a/doc/generate-sample-output.sh +++ b/doc/generate-sample-output.sh @@ -20,10 +20,10 @@ GITLAB_QA_LABELS="Testing" GITLAB_OK_LABELS="Accepted" issue_code="XY-1234" - -ticket_title="${issue_code} Lorem Ipsum" -ticket_url="https://mycompany.atlassian.net/browse/${issue_code}" -ticket_link="$(markdown_link "$ticket_title" "$ticket_url")" +issue_title="Lorem Ipsum" +issue_full_title="${issue_code} ${issue_title}" +issue_url="https://mycompany.atlassian.net/browse/${issue_code}" +issue_link="$(markdown_link "$issue_full_title" "$issue_url")" mr_title="Feature/${issue_code} Lorem Ipsum" mr_url="https://myapp.gitlab.com/my/project/merge_requests/6" @@ -37,7 +37,7 @@ fake_prompt() { local branch=${2:-"feature/xy-1234-lorem-ipsum"} colorize "\n___________________________________________________________________________________________\n\n\n" "gray" - echo "$(colorize "me@mystation" "green"):$(colorize "~/my-project" "lightblue") $(colorize "($branch)" "purple") $(colorize "↔ ✔" "green") $ $cmd" + echo "$(colorize "me@mystation" "green"):$(colorize "~/my-project" "lightblue") $(colorize "($branch)" "purple") $(colorize "↔ ✔ " "green") $ $cmd" } c_same() { @@ -60,7 +60,7 @@ sample_mr() { cat <> gitlab-mock-menu.log echo '[ - {"iid": 31,"title":"MR 31 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-C/-/merge_requests/31","state":"opened", "project_id": 3}, - {"iid": 11,"title":"MR 11 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-A/-/merge_requests/11","state":"opened", "project_id": 1}, - {"iid": 21,"title":"MR 21 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-B/-/merge_requests/21","state":"opened", "project_id": 2}, - {"iid": 41,"title":"MR 41 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-D/-/merge_requests/41","state":"closed", "project_id": 4} + {"iid": 31,"title":"MR 31 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-C/-/merge_requests/31","state":"opened","project_id":3}, + {"iid": 11,"title":"MR 11 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-A/-/merge_requests/11","state":"opened","project_id":1}, + {"iid": 21,"title":"MR 21 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-B/-/merge_requests/21","state":"opened","project_id":2}, + {"iid": 41,"title":"MR 41 title","web_url":"https://'${GITLAB_DOMAIN}'/proj-D/-/merge_requests/41","state":"closed","project_id":4} ]' ;; @@ -48,24 +48,28 @@ gitlab_merge_request() { 11) # echo "$f✔️ $1 $2" >> gitlab-mock-menu.log echo '{"iid": 11, "title": "MR 11 title", "project_id": 1, + "source_branch":"feature/branch-11", "web_url": "https://'${GITLAB_DOMAIN}'/proj-A/-/merge_requests/11", "head_pipeline": {"status": "running", "web_url": "https://'${GITLAB_DOMAIN}'/proj-A/-/pipelines/11"}, "state": "opened", "labels": ["QA"], "upvotes": 2, "downvotes": 0, "target_branch": "main", "merge_status": "can_be_merged"}';; 21) # echo "$f✔️ $1 $2" >> gitlab-mock-menu.log echo '{"iid": 21, "title": "MR 21 title", "project_id": 2, + "source_branch":"feature/branch-21", "web_url": "https://'${GITLAB_DOMAIN}'/proj-B/-/merge_requests/21", "head_pipeline": {"status": "failed", "web_url": "https://'${GITLAB_DOMAIN}'/proj-B/-/pipelines/21"}, "state": "opened", "labels": ["Review"], "upvotes": 0, "downvotes": 1, "target_branch": "main"}';; 31) # echo "$f✔️ $1 $2" >> gitlab-mock-menu.log echo '{"iid": 31, "title": "MR 31 title", "project_id": 3, + "source_branch":"feature/branch-31", "web_url": "https://'${GITLAB_DOMAIN}'/proj-C/-/merge_requests/31", "head_pipeline": {"status": "scheduled", "web_url": "https://'${GITLAB_DOMAIN}'/proj-C/-/pipelines/31"}, "state": "opened", "labels": ["Accepted"], "upvotes": 3, "downvotes": 0, "target_branch": "main", "merge_status": "can_be_merged"}';; 41) # echo "$f✔️ $1 $2" >> gitlab-mock-menu.log echo '{"iid": 41, "title": "MR 41 title", "project_id": 4, + "source_branch":"feature/branch-41", "web_url": "https://'${GITLAB_DOMAIN}'/proj-D/-/merge_requests/41", "head_pipeline": {"status": "failed", "web_url": "https://'${GITLAB_DOMAIN}'/proj-D/-/pipelines/41"}, "state": "closed", "labels": ["Review"], "upvotes": 0, "downvotes": 1, "merge_status": }';;