File tree Expand file tree Collapse file tree 12 files changed +53
-25
lines changed
Expand file tree Collapse file tree 12 files changed +53
-25
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,20 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
88ARCHIVE_NAME=$( basename $( pwd) )
99
1010if [[ $BRANCH = tags* ]]; then
11- BRANCH=$( git describe)
12- echo Building for tag \" $BRANCH \"
13- FILENAME=$ARCHIVE_NAME .$BRANCH .zip
11+ BRANCH=$( git describe)
12+ echo Building for tag \" $BRANCH \"
13+ FILENAME=$ARCHIVE_NAME .$BRANCH .zip
1414else
15- echo Building archive on branch \" $BRANCH \"
16- # get a version string, so archives will not be overwritten when creating
17- # many of them
18- VERSION=$( git describe --always --long)
19- # if not on master append branch name into the filename
20- if [ " $BRANCH " = " master " ]; then
21- FILENAME=$ARCHIVE_NAME .$VERSION .zip
22- else
23- FILENAME=$ARCHIVE_NAME .$VERSION .$BRANCH .zip
24- fi
15+ echo Building archive on branch \" $BRANCH \"
16+ # get a version string, so archives will not be overwritten when creating
17+ # many of them
18+ VERSION=$( git describe --always --long)
19+ # if not on master append branch name into the filename
20+ if [ " $BRANCH " = $( git_extra_default_branch ) ]; then
21+ FILENAME=$ARCHIVE_NAME .$VERSION .zip
22+ else
23+ FILENAME=$ARCHIVE_NAME .$VERSION .$BRANCH .zip
24+ fi
2525fi
2626
2727# rename invalid chars for the file path
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- branches=$( git branch --no-color --merged | grep -v " \*" | grep -v master | grep -v svn)
3+ branches=$( git branch --no-color --merged | grep -v " \*" | grep -v $( git_extra_default_branch ) | grep -v svn)
44if [ -n " $branches " ]
55then
66 echo " $branches " | xargs -n 1 git branch -d
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- branch=master
3+ branch=$( git_extra_default_branch )
44filter=ACM
55
66if test $# -eq 1; then
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ repository from scratch.
2222changed files will be reset, local branches and other remotes will be removed.
2323
2424OPTIONS:
25- -b, --branch The branch to pull from the remote (default: master)
25+ -b, --branch The branch to pull from the remote
2626 -h, --help Display this help message
2727"
2828}
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ echo " create pull-request for $project '$branch'"
6464echo
6565printf " title: " && read -r title
6666printf " body: " && read -r body
67- printf " base [master ]: " && read -r base
67+ printf " base [%s ]: " " $( git_extra_default_branch ) " && read -r base
6868printf " GitHub two-factor authentication code (leave blank if not set up): " && read -r mfa_code
6969echo
7070
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- git branch --no-color --merged | grep -v " \*" | grep -v master | tr -d ' '
3+ git branch --no-color --merged | grep -v " \*" | grep -v $( git_extra_default_branch ) | tr -d ' '
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- git branch --no-color --no-merged | grep -v " \*" | grep -v master | tr -d ' '
3+ git branch --no-color --no-merged | grep -v " \*" | grep -v $( git_extra_default_branch ) | tr -d ' '
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ commit_if_msg_provided() {
4343 fi
4444}
4545
46- prompt_continuation_if_squashing_master () {
47- if [[ $src =~ ^master$ ]]; then
46+ prompt_continuation_if_squashing_default_branch () {
47+ if [[ $src == $( git_extra_default_branch ) ]]; then
4848 read -p " Warning: squashing '$src '! Continue [y/N]? " -r
4949 if ! [[ $REPLY =~ ^[Yy]$ ]]; then
5050 echo " Exiting"
@@ -54,7 +54,7 @@ prompt_continuation_if_squashing_master() {
5454}
5555
5656squash_branch () {
57- prompt_continuation_if_squashing_master
57+ prompt_continuation_if_squashing_default_branch
5858 if [ -n " $SQUASH_MSG " ]; then
5959 base=$( git merge-base " $src " @)
6060 msg=$( git log " $base " .." $src " --format=" %s%n%n%b" --no-merges --reverse)
Original file line number Diff line number Diff line change @@ -5,3 +5,12 @@ git_extra_mktemp() {
55 mktemp -t "$(basename "$0")".XXXXXXX
66}
77
8+ git_extra_default_branch() {
9+ local default_branch
10+ default_branch=$(git config --get git-extras.default-branch)
11+ if [ -z "$default_branch" ]; then
12+ echo "master"
13+ else
14+ echo "$default_branch"
15+ fi
16+ }
Original file line number Diff line number Diff line change 11.\" generated with Ronn/v0.7.3
22.\" http://github.com/rtomayko/ronn/tree/0.7.3
33.
4- .TH "GIT\- EXTRAS" "1" "August 2020" "" "Git Extras"
4+ .TH "GIT\- EXTRAS" "1" "September 2020" "" "Git Extras"
55.
66.SH "NAME"
77\fB git \- extras \fR \- Awesome GIT utilities
@@ -27,6 +27,12 @@ update
2727.P
2828Self update\.
2929.
30+ .SH "ENVIRONMENT AND CONFIGURATION VARIABLES"
31+ \fB git config \-\- add git \- extras \. default \- branch $BRANCH \fR
32+ .
33+ .P
34+ Change the default branch to \fB $BRANCH \fR (defaut to \fB master \fR )\.
35+ .
3036.SH "COMMANDS"
3137.
3238.IP " \(bu " 4
You can’t perform that action at this time.
0 commit comments