Loading bin/git-supertree +12 −11 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ shopt -s dotglob [[ -v DEBUG ]] && set -x || true SCRIPT=$(basename $0) DEFAULT_BRANCH=$(git config init.defaultBranch || echo main) USAGE="Usage: $SCRIPT [-h] {init|clone|convert|add|mv|rm} [OPTION [OPTION ...]] Create 'super working trees', which are a trees of working trees. This is Loading @@ -39,8 +40,8 @@ USAGE="Usage: $SCRIPT [-h] {init|clone|convert|add|mv|rm} [OPTION [OPTION ...]] $SCRIPT init [WORKTREE-BASE] [-b BRANCH[:PATH]] Create a new super working tree at WORKTREE-BASE (default: current directory) -b --branch Create an initial branch named BRANCH (default: 'master') checked out at PATH (default: BRANCH) relative to WORKTREE-BASE. -b --branch Create an initial branch named BRANCH (default: $DEFAULT_BRANCH) checked out at PATH (default: BRANCH) relative to WORKTREE-BASE. $SCRIPT clone URL [WORKTREE-BASE] [-b BRANCH[:PATH]] Clone a remote repository at URL in a super working tree at Loading @@ -50,11 +51,11 @@ $SCRIPT clone URL [WORKTREE-BASE] [-b BRANCH[:PATH]] BRANCH (default: origin/HEAD) at PATH (default: BRANCH) relative to WORKTREE-BASE. $SCRIPT convert [REPOPATH] [-m MASTER] $SCRIPT convert [REPOPATH] [-m MAIN] Convert a regular git working tree + repository at WORKTREE (default: PWD) into a super working tree. -m --master Point the base HEAD symbolic ref to MASTER -m --main Point the base HEAD symbolic ref to MAIN (default: current HEAD) $SCRIPT add [--from SOURCE|--orphan] BRANCH[:PATH] Loading Loading @@ -170,7 +171,7 @@ new_repo() set_head() ( cd "$1" git symbolic-ref HEAD refs/heads/${2-master} git symbolic-ref HEAD refs/heads/$2 ) get_head() Loading Loading @@ -249,7 +250,7 @@ readlink() action_init() { local REPOPATH BRANCH_SPEC=master:master local REPOPATH BRANCH_SPEC=$DEFAULT_BRANCH:$DEFAULT_BRANCH while [[ $# -gt 0 ]]; do case $1 in -b|--branch) BRANCH_SPEC=$2; shift ;; Loading Loading @@ -306,10 +307,10 @@ action_clone() action_convert() { local REPOPATH=. MASTER local REPOPATH=. MAIN while [[ $# -gt 0 ]]; do case $1 in -m|--master) MASTER="$2"; shift ;; -m|--main|--master) MAIN="$2"; shift ;; *) case '' in "${REPOPATH-}") REPOPATH=$1 ;; *) arg_error "Unknown argument: $1" ;; Loading Loading @@ -360,8 +361,8 @@ action_convert() git config core.bare true if [[ -v MASTER ]]; then git symbolic-ref HEAD refs/heads/$MASTER if [[ -v MAIN ]]; then git symbolic-ref HEAD refs/heads/$MAIN fi rm .backup.tar Loading Loading
bin/git-supertree +12 −11 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ shopt -s dotglob [[ -v DEBUG ]] && set -x || true SCRIPT=$(basename $0) DEFAULT_BRANCH=$(git config init.defaultBranch || echo main) USAGE="Usage: $SCRIPT [-h] {init|clone|convert|add|mv|rm} [OPTION [OPTION ...]] Create 'super working trees', which are a trees of working trees. This is Loading @@ -39,8 +40,8 @@ USAGE="Usage: $SCRIPT [-h] {init|clone|convert|add|mv|rm} [OPTION [OPTION ...]] $SCRIPT init [WORKTREE-BASE] [-b BRANCH[:PATH]] Create a new super working tree at WORKTREE-BASE (default: current directory) -b --branch Create an initial branch named BRANCH (default: 'master') checked out at PATH (default: BRANCH) relative to WORKTREE-BASE. -b --branch Create an initial branch named BRANCH (default: $DEFAULT_BRANCH) checked out at PATH (default: BRANCH) relative to WORKTREE-BASE. $SCRIPT clone URL [WORKTREE-BASE] [-b BRANCH[:PATH]] Clone a remote repository at URL in a super working tree at Loading @@ -50,11 +51,11 @@ $SCRIPT clone URL [WORKTREE-BASE] [-b BRANCH[:PATH]] BRANCH (default: origin/HEAD) at PATH (default: BRANCH) relative to WORKTREE-BASE. $SCRIPT convert [REPOPATH] [-m MASTER] $SCRIPT convert [REPOPATH] [-m MAIN] Convert a regular git working tree + repository at WORKTREE (default: PWD) into a super working tree. -m --master Point the base HEAD symbolic ref to MASTER -m --main Point the base HEAD symbolic ref to MAIN (default: current HEAD) $SCRIPT add [--from SOURCE|--orphan] BRANCH[:PATH] Loading Loading @@ -170,7 +171,7 @@ new_repo() set_head() ( cd "$1" git symbolic-ref HEAD refs/heads/${2-master} git symbolic-ref HEAD refs/heads/$2 ) get_head() Loading Loading @@ -249,7 +250,7 @@ readlink() action_init() { local REPOPATH BRANCH_SPEC=master:master local REPOPATH BRANCH_SPEC=$DEFAULT_BRANCH:$DEFAULT_BRANCH while [[ $# -gt 0 ]]; do case $1 in -b|--branch) BRANCH_SPEC=$2; shift ;; Loading Loading @@ -306,10 +307,10 @@ action_clone() action_convert() { local REPOPATH=. MASTER local REPOPATH=. MAIN while [[ $# -gt 0 ]]; do case $1 in -m|--master) MASTER="$2"; shift ;; -m|--main|--master) MAIN="$2"; shift ;; *) case '' in "${REPOPATH-}") REPOPATH=$1 ;; *) arg_error "Unknown argument: $1" ;; Loading Loading @@ -360,8 +361,8 @@ action_convert() git config core.bare true if [[ -v MASTER ]]; then git symbolic-ref HEAD refs/heads/$MASTER if [[ -v MAIN ]]; then git symbolic-ref HEAD refs/heads/$MAIN fi rm .backup.tar Loading