Skip to content

Commit

Permalink
Merge pull request #20 from Djuuu/feature/short-option
Browse files Browse the repository at this point in the history
Introduce `--short` option
  • Loading branch information
Djuuu authored Jul 5, 2024
2 parents c09fa24 + f9c77cb commit 41563ab
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ Prepares a merge request description, with link to Jira ticket and current branc
* `-e`, `--extended`
Use full commit messages in description ("extended", for `git mr [open|update]`).
You can also set `GIT_MR_EXTENDED=1` in your environment variables to always use extended commit descriptions.
* `-s`, `--short`
Use short commit messages in description.
Useful when extended mode is enabled in configuration or environment.
* `--no-color`
Disable terminal colors.
* `--no-links`
Expand Down
1 change: 1 addition & 0 deletions completion/_git-mr
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ _git-mr() {
case $mr_action in default|open|update) opts+=(
'(-t --target)'{-t,--target}'[force target branch]:merge request target branch:->target_branch'
'(-e --extended)'{-e,--extended}'[use full commit messages in description]'
'(-s --short)'{-s,--short}'[use short commit messages in description]'
'(--no-commits)'--no-commits'[omit commit list from description]'
);; esac
case $mr_action in default|open|status|menu-status) opts+=(
Expand Down
7 changes: 6 additions & 1 deletion git-mr
Original file line number Diff line number Diff line change
Expand Up @@ -2732,6 +2732,10 @@ ${b}OPTIONS${r}
Use full commit messages in description ("extended", for \`git mr [open|update]\`).
You can also set GIT_MR_EXTENDED=1 in your environment variables to always use extended commit descriptions.
-s, --short
Use short commit messages in description.
Useful when extended mode is enabled in configuration or environment.
--no-color
Disable terminal colors.
Expand Down Expand Up @@ -2928,6 +2932,7 @@ while [[ $# -gt 0 ]]; do
-t|--target) GIT_MR_TARGET="$2"; shift ;;

-e|--extended) GIT_MR_EXTENDED=1 ;;
-s|--short) GIT_MR_EXTENDED=0 ;;

--no-color) GIT_MR_NO_COLORS=1 ;;
--no-links) GIT_MR_NO_TERMINAL_LINK=1 ;;
Expand All @@ -2939,7 +2944,7 @@ while [[ $# -gt 0 ]]; do
# mr update
-n|--new-section) GIT_MR_UPDATE_NEW_SECTION=1
case "$2" in
-c|--code | -t|--target | -e|--extended | --no-color|--no-links | -y|--yes | -v|--verbose | -r|--replace-commits | -f|--force | -h) ;;
-c|--code | -t|--target | -e|--extended | -s|--short | --no-color|--no-links | -y|--yes | -v|--verbose | -r|--replace-commits | -f|--force | -h) ;;
*) GIT_MR_UPDATE_NEW_SECTION_NAME="$2"; shift ;;
esac ;;
-r|--replace-commits) GIT_MR_REPLACE_COMMITS=1 ;;
Expand Down
1 change: 1 addition & 0 deletions git-mr-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ _git_mr() {
case $mr_action in default | open | update)
__gitcomp_nl_append '-t'; __gitcomp_nl_append '--target'
__gitcomp_nl_append '-e'; __gitcomp_nl_append '--extended'
__gitcomp_nl_append '-s'; __gitcomp_nl_append '--short'
__gitcomp_nl_append '--no-commits'
;; esac
case $mr_action in default | open | status | menu-status)
Expand Down

0 comments on commit 41563ab

Please sign in to comment.