diff options
author | David Goulet <dgoulet@torproject.org> | 2021-10-26 15:52:51 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-10-26 15:52:53 -0400 |
commit | 5e1f64602bd11fc24c72f0617c362aa7ab79f0d8 (patch) | |
tree | c9228a228a774a625496f4add625e17635463fd5 /scripts | |
parent | 304bd31d494e1dd4066b1238db8a9909f0652726 (diff) | |
download | tor-5e1f64602bd11fc24c72f0617c362aa7ab79f0d8.tar.gz tor-5e1f64602bd11fc24c72f0617c362aa7ab79f0d8.zip |
scripts: Add -M option to git-list-tor-branches.sh
Omit all "maint" branch. It is the opposite of -R that omits release
branches.
In other words, -M can be used to list all release branches.
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/git/git-list-tor-branches.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/git/git-list-tor-branches.sh b/scripts/git/git-list-tor-branches.sh index 62547dcc5d..29e91dd1b6 100755 --- a/scripts/git/git-list-tor-branches.sh +++ b/scripts/git/git-list-tor-branches.sh @@ -8,7 +8,7 @@ SCRIPT_NAME=$(basename "$0") function usage() { - echo "$SCRIPT_NAME [-h] [-l|-s|-b|-m] [-R]" + echo "$SCRIPT_NAME [-h] [-l|-s|-b|-m] [-R|-M]" echo echo " arguments:" echo " -h: show this help text" @@ -20,6 +20,7 @@ function usage() echo " ( branch parent path suffix parent_suffix ) arrays" echo echo " -R: omit release branches." + echo " -M: omit maint branches." } # list : just a list of branch names. @@ -27,9 +28,10 @@ function usage() # suffix: write a list of suffixes. # merge: branch, upstream, path, suffix, upstream suffix. mode="list" +skip_maint_branches="no" skip_release_branches="no" -while getopts "hblmsR" opt ; do +while getopts "hblmsRM" opt ; do case "$opt" in h) usage exit 0 @@ -42,6 +44,8 @@ while getopts "hblmsR" opt ; do ;; m) mode="merge" ;; + M) skip_maint_branches="yes" + ;; R) skip_release_branches="yes" ;; *) echo "Unknown option" @@ -80,6 +84,9 @@ branch() { suffix="_${brname_nodots#maint-}" location="\$GIT_PATH/\$TOR_WKT_NAME/$brname" is_maint="yes" + if [[ "$skip_maint_branches" = "yes" ]]; then + return + fi elif [[ "$brname" =~ ^release- ]]; then suffix="_r${brname_nodots#release-}" location="\$GIT_PATH/\$TOR_WKT_NAME/$brname" |