diff options
-rwxr-xr-x | construct-tree.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/construct-tree.sh b/construct-tree.sh index 391ce6c..36588ab 100755 --- a/construct-tree.sh +++ b/construct-tree.sh @@ -26,7 +26,7 @@ build_depth_1 () { set -e $verbose - git br top + git branch top local file local index=1 @@ -40,10 +40,10 @@ build_depth_1 () { local tag=$index git add $file - git ci -m $tag >/dev/null + git commit -m $tag >/dev/null echo "Committing 1/$tag: $file" - git br 1/$tag + git branch 1/$tag git reset HEAD^ >/dev/null index=$(($index+1)) @@ -75,7 +75,7 @@ merge_branches () { local parents="" if git rev-parse --verify $depth/$tag >/dev/null 2>&1; then parents="$(git rev-list --parents -n 1 $depth/$tag | cut -d" " -f 2-)" - git br -D $depth/$tag + git branch -D $depth/$tag fi parents="$parents ${branches[@]}" @@ -86,7 +86,7 @@ merge_branches () { git stash pop >/dev/null echo "Creating $depth/$tag from $parents" - git br $depth/$tag + git branch $depth/$tag git reset $orig_tag >/dev/null } @@ -103,7 +103,7 @@ build_depth () { local br1 local br2 - branches=($(git br --list "$depth_1/*")) + branches=($(git branch --list "$depth_1/*")) br1=0 while [ $br1 -lt ${#branches[@]} ]; do @@ -129,20 +129,20 @@ build_depth_final () { local -a branches - branches=($(git br --list "$depth_1/*")) + branches=($(git branch --list "$depth_1/*")) merge_branches $depth "${branches[@]}" local bottom - bottom=$(git br --list "$depth/*") + bottom=$(git branch --list "$depth/*") git reset --hard - git co $bottom - git br bottom + git checkout $bottom + git branch bottom echo "Finished depth: $depth" } -files=($(git st -s | grep "^ M " | sed -e "s/^ M //" | sort)) +files=($(git status -s | grep "^ M " | sed -e "s/^ M //" | sort)) if [ $max_depth -gt ${#files[@]} ]; then max_depth=${#files[@]} |