git-compose
Advanced tools
+1
-1
| { | ||
| "name": "git-compose", | ||
| "version": "0.1.3", | ||
| "version": "0.2.0", | ||
| "description": "Compose GIT branches and cascade merge updates", | ||
@@ -5,0 +5,0 @@ "repository": { |
+62
-19
@@ -247,5 +247,5 @@ #!/usr/bin/env bash | ||
| case "$x" in | ||
| --fetch|-f) args+=( -f ) ;; | ||
| --verbose|-v) args+=( -v ) ;; | ||
| *) args+=( "$x" ) ;; | ||
| --fetch|-f) args+=( -f ) ;; | ||
| --not-verbose|-v) args+=( -v ) ;; | ||
| *) args+=( "$x" ) ;; | ||
| esac | ||
@@ -257,3 +257,3 @@ done | ||
| local SHOULD_FETCH=0 | ||
| local IS_VERBOSE=0 | ||
| local IS_VERBOSE=1 | ||
@@ -264,3 +264,3 @@ unset OPTIND | ||
| f) SHOULD_FETCH=1 ;; | ||
| v) IS_VERBOSE=1 ;; | ||
| v) IS_VERBOSE=0 ;; | ||
| esac | ||
@@ -444,28 +444,71 @@ done | ||
| cascade_merge () { | ||
| # ... args | ||
| local args=( ) | ||
| for x; do | ||
| case "$x" in | ||
| --from|-f) args+=( -f ) ;; | ||
| *) args+=( "$x" ) ;; | ||
| esac | ||
| done | ||
| set -- "${args[@]}" | ||
| local FROM_BRANCH=$ROOT_BRANCH | ||
| unset OPTIND | ||
| while getopts ":f:" x; do | ||
| case "$x" in | ||
| f) FROM_BRANCH="${OPTARG}" ;; | ||
| esac | ||
| done | ||
| # ... validate from branch | ||
| if [[ "${FROM_BRANCH}" != "${ROOT_BRANCH}" ]] && [[ "${FROM_BRANCH}" != "iso__"* ]] ; then | ||
| echo "Please provide a valid from branch -f or --from (only iso__ branches are supported)" | ||
| exit 1 | ||
| fi | ||
| # ... | ||
| cascade_merge_prechecks | ||
| # ... checkout root branch | ||
| git checkout "${ROOT_BRANCH}" -q | ||
| # ... checkout from branch | ||
| git checkout "${FROM_BRANCH}" -q | ||
| # ... cascade merge Isolation branches | ||
| # ... cascade merge Isolation branches (optionally from a specfic branch) | ||
| h1 "Isolation Branches"; echo "" ; echo "" | ||
| echo -e "${DIR_SYMBOL} ${ROOT_BRANCH}" | ||
| for BRANCH in $(git for-each-ref refs/heads --format='%(refname:lstrip=2)' | grep '^iso__'); do | ||
| if [[ "${BRANCH}" != "${ROOT_BRANCH}" ]] ; then | ||
| cascade_merge_isolation_branch "${BRANCH}" | ||
| if [[ "${FROM_BRANCH}" == "${ROOT_BRANCH}" ]] || [[ "${FROM_BRANCH}" == "iso__"* ]] ; then | ||
| local ISO_GREP="^iso__" | ||
| if [[ "${FROM_BRANCH}" != "${ROOT_BRANCH}" ]] ; then | ||
| ISO_GREP="${FROM_BRANCH}" | ||
| fi | ||
| done | ||
| echo "" | ||
| # ... cascade merge Integration branches | ||
| echo -e "${DIR_SYMBOL} ${FROM_BRANCH}" | ||
| local ISO_BRANCHES=$(git for-each-ref refs/heads --format='%(refname:lstrip=2)' | grep "${ISO_GREP}") | ||
| for BRANCH in $ISO_BRANCHES; do | ||
| if [[ "${BRANCH}" != "${ROOT_BRANCH}" ]] ; then | ||
| cascade_merge_isolation_branch "${BRANCH}" | ||
| fi | ||
| done | ||
| echo "" | ||
| fi | ||
| # ... cascade merge Integration branches (only from root) | ||
| h1 "Integration Branches"; echo "" ; echo "" | ||
| for BRANCH in $(git for-each-ref refs/heads --format='%(refname:lstrip=2)' | grep '^int__'); do | ||
| cascade_merge_integration_branch "${BRANCH}" | ||
| done | ||
| echo "" | ||
| if [[ "${FROM_BRANCH}" == "${ROOT_BRANCH}" ]] ; then | ||
| local INT_BRANCHES=$(git for-each-ref refs/heads --format='%(refname:lstrip=2)' | grep '^int__') | ||
| for BRANCH in $INT_BRANCHES; do | ||
| cascade_merge_integration_branch "${BRANCH}" | ||
| done | ||
| echo "" | ||
| fi | ||
| # ... re-checkout current branch | ||
@@ -472,0 +515,0 @@ git checkout "${CURRENT_BRANCH}" -q |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15054
7.21%1
-50%